aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt about IO package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt about IO package" Watch "Doubt about IO package" New topic
Author

Doubt about IO package

vivekkumar sharma
Ranch Hand

Joined: Dec 21, 2005
Posts: 70
Hi Ranchers,

In the following code I get IOexception : Stream already closed.
It works fine if i comment line 1 below.

I am not sure how buffered writer works.
Can some one explain, does BufferedWriter open FileWriter dtream before writing or not.

TA
Vivek

wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
In BufferedWriter.java code, its write function does not open file.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18123
    
  39

Furthermore, in order for the BufferedWriter to work "properly", you should not be writing directly to the FileWriter.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt about IO package
 
Similar Threads
Not able to write the output to the file.
FileWriter
FileIO
FileWriter vs BufferedWriter(FileWriter)
BufferedWriter, PrinterWriter etc