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



Ask a Question

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. Thank you for the script.
I was searching f

View Tutorial          By: MUhammad Faizal at 2008-04-10 08:23:54

2. i am getting an exceptions... pls help me..

View Tutorial          By: FEBI at 2014-03-08 06:01:44

3. would you please send me a code that can be run pl
View Tutorial          By: putra at 2008-12-17 13:26:26

4. i really hate do while loop statement, can u pls h
View Tutorial          By: mARjO at 2011-09-01 03:50:18

5. Mail me Codings in java of different programs
View Tutorial          By: vikram at 2008-09-12 06:04:42

6. I running this on localhost offline and getting er
View Tutorial          By: nitisha at 2011-05-14 09:18:16

7. Hi,

As you shown here that we have

View Tutorial          By: Keyur at 2011-04-05 03:30:12

8. This the very good introduction to the J2ME for th
View Tutorial          By: chetan jain at 2010-04-01 06:39:32

9. How to connect a webpage(which I have created for
View Tutorial          By: sam at 2012-01-24 10:10:52

10. Thanks
Your solution helped me a lot :)

View Tutorial          By: sendhil at 2010-05-28 01:12:41