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. This program not running on my system so give some
View Tutorial          By: Ajay Kumar Barik at 2009-06-15 02:28:47

2. Hi,

I have tried with your script a

View Tutorial          By: Ivan at 2011-09-08 21:17:36

3. Thanks, Just what i was looking for.
View Tutorial          By: Baapu at 2009-10-21 15:21:43

4. This should save some time

class pa

View Tutorial          By: vamsi gude at 2012-03-20 18:27:24

5. i didnot get the answer
View Tutorial          By: ramana at 2013-02-04 06:36:37

6. respected Sir , I am doing B.Tech . I want to know
View Tutorial          By: naveen juneja at 2011-09-18 07:58:04

7. hello!!can anyone help me. can you send me the com
View Tutorial          By: denisse at 2008-01-07 05:40:25

8. "THIS IS SAMPLE EXMPLE!!!!!!!!!!11111"
View Tutorial          By: david billa at 2012-08-02 06:23:43

9. Very good explanation specially overlapped memory
View Tutorial          By: MANISH RASTOGI at 2010-06-22 05:44:07

10. Handling several submissions can be a lot simple t
View Tutorial          By: Blaze Blankenship at 2012-12-05 13:04:12