Comment on Tutorial - FileReader and FileWriter example program in Java By Tamil Selvan



Comment Added by : João

Comment Added at : 2012-04-11 19:22:14

Comment on Tutorial : FileReader and FileWriter example program in Java By Tamil Selvan
The actual code to write F2 is:
f2.write(buffer,buffer.length-buffer.length/4,buffer.length/4);
f2.close();

Because here you "say"
Write the buffer.
Starting from buffer.length-buffer.length/4
= 96-(96/4) = 96-24 = 72.
Than it will start after the 72tah char of buffer.

And finally write buffer.length/4 = (24 chars)


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. FilenameFilter only = new OnlyExt("html"
View Tutorial          By: joyes at 2009-08-25 11:34:13

2. if done all the steps but i have found out this er
View Tutorial          By: hisham at 2010-11-24 11:01:54

3. why we user serialization
View Tutorial          By: sonia at 2011-12-08 08:25:25

4. Hiiii Al, I am Ashraf Abu Aisheh, i am working to
View Tutorial          By: Ashraf Abu Aisheh at 2008-11-09 14:56:39

5. Good introduction to J2ME..thanks for sharing this
View Tutorial          By: Som at 2010-11-13 00:03:53

6. Hi, I cant open the file after I click Write SD. I
View Tutorial          By: hassan at 2014-12-17 07:44:16

7. Many thanks!
View Tutorial          By: Bego at 2014-07-10 08:48:02

8. pls can any one have any idea about storing the ca
View Tutorial          By: souhir at 2010-01-30 11:04:48

9. You should add the mime type as follows:

View Tutorial          By: Anonymous at 2009-03-19 08:30:35

10. somebody help me doing my case study .. its a rese
View Tutorial          By: lady at 2013-12-25 08:21:03