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. To install 32 bit java Communication API you can f
View Tutorial          By: Shailendra at 2013-04-06 14:49:44

2. gooooooodddddddd
View Tutorial          By: arya tandon at 2015-02-23 09:08:05

3. not that much clear exampl.. you should explain it
View Tutorial          By: elangovan at 2010-06-09 02:36:19

4. Sometimes java do support operator overloading as
View Tutorial          By: Gunjan Srivastava at 2011-07-06 09:14:00

5. nice example
View Tutorial          By: pavang at 2010-07-20 01:16:22

6. I really helped with this tutorial.
In case

View Tutorial          By: maya at 2008-07-30 00:35:51

7. Thank you......... It's very helpful.
View Tutorial          By: Ramesh Kumar Mahto at 2010-09-01 12:12:30

8. A lucid explanantion is "when a method name i
View Tutorial          By: harshnil at 2013-01-15 03:57:44

9. IT IS VERY USEFUL FOR BEGINNERS
View Tutorial          By: Adhi Rudran at 2007-04-16 02:58:47

10. Thanks for the info
View Tutorial          By: info at 2010-01-31 12:17:58