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. M having query
i wat to create employee cla

View Tutorial          By: Dayasagar at 2010-05-22 16:18:17

2. Good piece of information explained wonderfully. !
View Tutorial          By: Juzar at 2009-07-23 00:24:40

3. Hi,
My problem is with daybook. In

View Tutorial          By: Priyesh at 2011-07-06 06:34:33

4. Hi,
Even if the while loops (in Producer an

View Tutorial          By: Pranay at 2012-09-19 19:08:45

5. Its really good.....
View Tutorial          By: Shivam at 2009-04-02 03:58:51

6. great explanations.. some important words are miss
View Tutorial          By: Joshua Paul at 2015-04-14 03:43:44

7. nice article...........................
View Tutorial          By: abhijit at 2012-09-24 11:12:46

8. welll program runs but fails at the statement wher
View Tutorial          By: Aman Aggarwal at 2009-03-22 22:42:52

9. thanks i understood
View Tutorial          By: raksha at 2012-11-04 16:44:19

10. nice examlpe but u can make it more easy frnd
View Tutorial          By: meghendra at 2009-02-14 00:21:31