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. Hi Nithya,
yes you can do that see the tut

View Tutorial          By: Ramlak at 2009-03-04 01:20:01

2. Neatly explained about the three important functio
View Tutorial          By: Jitendra Lenka at 2011-02-03 06:34:10

3. I'm sorry I've misunderstood, join() guarantees th
View Tutorial          By: Junkie Zhang at 2012-01-10 06:02:00

4. tell me the new page create in java and attach wi
View Tutorial          By: muhammad nadeem at 2011-07-06 00:12:08

5. Can u please tell me how to compile and execute a
View Tutorial          By: RJ at 2010-04-20 01:30:10

6. hi all !

This is the error im getti

View Tutorial          By: Ajit at 2010-02-17 23:09:47

7. Good for Beginners
View Tutorial          By: Srinivasula Reddy at 2009-11-05 02:04:25

8. I did this exactly.
In my case, the fix.php

View Tutorial          By: Manorasa at 2010-06-29 23:32:24

9. HELP ME HOW TO ANALZE THE PROGRAM??????????
View Tutorial          By: MICHELLE FLORES at 2009-01-21 23:24:52

10. pls help how to fetch vowels as a first letter of
View Tutorial          By: anjali at 2014-09-18 20:45:49