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. if the number is for exemple 00025478 it return a
View Tutorial          By: ahmed at 2015-02-11 12:02:45

2. sap crystal active-x design
failed to open

View Tutorial          By: Mubarak at 2012-11-11 17:16:54

3. Good introduction to J2ME..thanks for sharing this
View Tutorial          By: Som at 2010-11-13 00:03:53

4. hi! we tried using the 5 java files...we build the
View Tutorial          By: anne226 at 2009-02-10 23:58:46

5. hello sir i want to know how to run this pogram as
View Tutorial          By: Pranjay at 2009-01-07 03:33:45

6. sir,
When I run the above code and give 6 o

View Tutorial          By: nishant at 2012-07-01 17:11:20

7. How to read an array using BufferedReader?

View Tutorial          By: Dilnur Yuldashev at 2011-07-24 02:00:48

8. Able to connect to mobile
Unable to send me

View Tutorial          By: Prashant at 2011-04-24 01:16:27

9. HI all,

I am not able to call SMSC

View Tutorial          By: chinnadurai at 2009-08-26 23:58:54

10. Excellent information
View Tutorial          By: mahesh at 2014-10-18 06:07:35