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. great answer...
View Tutorial          By: nagi ponnagani at 2011-04-29 14:11:21

2. Thanks, you save my day!
View Tutorial          By: ivex at 2015-06-25 20:20:07

3. This example is very useful....Thanks for your sha
View Tutorial          By: raji at 2015-05-22 07:19:07

4. i am developing a video streaming PC server to j2m
View Tutorial          By: Jamsiya at 2011-08-11 05:07:01

5. it is perfectly working...
View Tutorial          By: Venkatesh at 2014-09-21 06:54:39

6. i need to send some file usin a bluetooth devicem
View Tutorial          By: igle85 at 2012-01-25 06:27:50

7. This is pretty straightforward and got me to under
View Tutorial          By: Renoir Boulanger at 2009-09-01 09:49:24

8. thanx very much...
View Tutorial          By: Rajesh at 2015-10-09 08:57:36

9. The tutorial is simple and clear.
@Gnani, i

View Tutorial          By: Tayo at 2010-01-03 13:10:24

10. Hi All,

This code is working fine i

View Tutorial          By: A.Balaji at 2010-09-27 04:40:38