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. i am run code this rectify this error please some
View Tutorial          By: indiran at 2010-01-28 01:45:56

2. Your script works beautifully. Is there a way to i
View Tutorial          By: JW at 2013-05-08 22:22:44

3. Those who want the details of JAVA should search f
View Tutorial          By: Amit Singh at 2011-11-13 11:42:42

4. Hi,

Can we use this fix.php on the

View Tutorial          By: Chriz at 2010-07-05 09:22:57

5. its a good example
View Tutorial          By: Sonal at 2009-03-25 08:35:10

6. that's what I've been looking for!!!!!!!!!!!!!!!!!
View Tutorial          By: bibi at 2014-12-28 20:43:56

7. Thanks Man!! Been searching for a simple one like
View Tutorial          By: Kid at 2012-10-12 14:15:43

8. i need some more basic java programs in all type
View Tutorial          By: jkamal at 2012-11-05 04:57:49

9. I tried running this code.. I used motorazr v3i as
View Tutorial          By: Arvind at 2009-02-14 10:24:37

10. Thanks, it was really helpful.
But wouldn't

View Tutorial          By: Ron at 2010-06-27 14:22:36