• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt about IO package

 
vivekkumar sharma
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In BufferedWriter.java code, its write function does not open file.
 
Henry Wong
author
Marshal
Pie
Posts: 21184
80
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Furthermore, in order for the BufferedWriter to work "properly", you should not be writing directly to the FileWriter.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic