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. hi friends i hav project work in this topic so pls
View Tutorial          By: sullan at 2011-05-08 12:08:56

2. Hi,first of all thats for this code developer, its
View Tutorial          By: Kathir at 2008-02-08 06:16:51

3. I have tried that but still getting the same error
View Tutorial          By: pra at 2008-04-14 21:55:44

4. Hi Friends,
Saw all of your comments. The a

View Tutorial          By: Avinash at 2011-11-28 04:43:09

5. Simpler example:

import java.io.*;

View Tutorial          By: Joseph Harner at 2011-12-04 23:20:48

6. i have to learn java
View Tutorial          By: md arif alam at 2013-04-15 18:30:27

7. this site is really very useful.
it provide

View Tutorial          By: ankush bansal at 2009-11-12 08:34:13

8. Thx, this helped a lot.

How can I I

View Tutorial          By: Marko at 2008-10-09 01:32:37

9. Very usefull info.. Thank alot
View Tutorial          By: Srikanth at 2012-09-04 15:44:30

10. hello after working with this code i got the follw
View Tutorial          By: Tapaswini Sabat at 2011-11-05 12:43:49