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



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. This example is working fine....I think BillGates
View Tutorial          By: Monoj Rath at 2010-07-15 01:27:51

2. Hi there! the coding are SUPERB..bt i do nd help i
View Tutorial          By: lily sandra at 2008-01-15 18:30:33

3. Is it possible for you to create for me a mobile a
View Tutorial          By: Meme at 2008-12-23 06:24:42

4. Hello,
I would like to know how will take p

View Tutorial          By: Jeff at 2011-02-02 23:05:17

5. This works with inserts but it is very slow for lo
View Tutorial          By: Antonio Pereira at 2011-02-04 08:54:45

6. Hi ,

Is there any way to export con

View Tutorial          By: Nithya Duraiswamy at 2009-03-03 21:32:05

7. Thanks a lot, a long time I search for solution fo
View Tutorial          By: Jonhnes at 2013-02-16 17:17:47

8. i have same error sir..
Error applying tran

View Tutorial          By: CRUDZ at 2013-10-13 05:22:24

9. what is the return type for clicker method? The pr
View Tutorial          By: Gautam at 2013-10-14 15:36:27

10. what if i want to create a digital signature on th
View Tutorial          By: Chandra at 2012-06-10 00:52:15