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:20:51

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 72th 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. Oh! Emiley, thank you very much! There are two lo
View Tutorial          By: Alexey at 2009-04-09 14:17:31

2. java to learn is very easy .................but do
View Tutorial          By: yunus khan at 2012-12-06 17:28:41

3. very easy explain
View Tutorial          By: Rohit Bhojani at 2012-04-10 12:49:20

4. nice material
View Tutorial          By: ravi at 2008-12-24 00:40:12

5. Bless you, bless you, bless you! You've kept me f
View Tutorial          By: KRuthenberg at 2009-09-25 19:42:55

6. You said the garbage collector can not be forced,
View Tutorial          By: Biniam E at 2011-12-17 15:09:09

7. i run this program. its not showing any runtime or
View Tutorial          By: anand sp at 2011-03-07 10:11:37

8. nice one
View Tutorial          By: dhusor at 2012-05-08 17:38:50

9. very nicely explained,
thank you

View Tutorial          By: Amin at 2010-04-14 09:40:30

10. Sir , I am doing BCA . I want to know more about j
View Tutorial          By: sandeep Namdev at 2008-09-16 05:47:22