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. very nice..!
View Tutorial          By: neeraj at 2012-04-21 11:12:08

2. Hi,

This is very nice tutorial to

View Tutorial          By: Robvandam at 2010-05-03 00:29:38

3. hi sr.
do u have any idea have any idea how

View Tutorial          By: mirna at 2012-03-27 05:47:34

4. is anyone going to post the complete version of th
View Tutorial          By: anon at 2009-04-21 12:26:51

5. This works with inserts but it is very slow for lo
View Tutorial          By: Antonio Pereira at 2011-02-04 08:54:45

6. can we use this code in a web application. your he
View Tutorial          By: phani at 2008-09-17 06:15:26

7. Can I use my Nokia 6300 as my GSM Modem???? Please
View Tutorial          By: deKi at 2009-03-17 03:54:59

8. please tell me.........
View Tutorial          By: case c++ at 2012-02-20 02:45:55

9. it is very good for best practice of basics.......
View Tutorial          By: sushil ghimire at 2015-03-01 13:27:57

10. Thank you very much for this tip.
View Tutorial          By: Lise at 2011-07-15 13:27:23