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



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. THANKS!!!
Just the essential, core things-t

View Tutorial          By: Galaxio at 2010-12-29 04:25:33

2. right to point.. thanks man
View Tutorial          By: manish at 2012-07-28 15:01:26

3. Your example is clear crisp and very helpful..
View Tutorial          By: sridhar at 2009-08-06 08:41:14

4. change
for(counter=0;counter<=length-1;l

View Tutorial          By: Dan at 2012-05-28 04:53:14

5. is it possible to change the increment variable?
View Tutorial          By: Lundi at 2013-04-08 21:21:13

6. IS Java Comm API will supports thw windows?
View Tutorial          By: SAM at 2008-05-29 03:26:44

7. i have created the main class to run the five clas
View Tutorial          By: Muraya at 2014-04-08 14:48:36

8. works for me - thanks !!!!!
View Tutorial          By: Vaneeza at 2011-12-19 17:06:09

9. Hiii....i am using windows 8..jdk1.7.51 and netbea
View Tutorial          By: Pravin Kamble at 2014-05-03 07:00:12

10. what if the delimiter is "(quotation mark)?
View Tutorial          By: hiakoto at 2013-02-18 16:15:20