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. Thanks for everything... I'm greeting you from Aze
View Tutorial          By: Shahriyar at 2011-04-28 15:54:14

2. my requirement is i have a source string as src{&q
View Tutorial          By: Anil at 2014-10-27 08:36:23

3. Tnx. Very fast learning i think.
Just make

View Tutorial          By: mahdi at 2011-07-09 20:20:39

4. I entered four different objects into an ArrayList
View Tutorial          By: ADC at 2010-02-25 18:43:32

5. thank u.actually i want little more...
View Tutorial          By: burhan at 2010-07-13 03:46:01

6. Thanks, very helpful. Worked perfectly.
View Tutorial          By: Bob Knob at 2011-07-27 18:22:18

7. hola

no funciona este
Stri

View Tutorial          By: ahmed at 2012-05-11 14:18:46

8. Thanks for the article. I got some clearance now.
View Tutorial          By: Reddy at 2008-03-15 00:02:17

9. not satisfied friend. for Socket class it asks to
View Tutorial          By: Gaurav at 2009-01-28 07:34:42

10. Hi ,
please i need j2me appliacation :

View Tutorial          By: youyou92 at 2014-12-01 18:20:52