• Post Reply Bookmark Topic Watch Topic
  • New Topic

Closing Stream

 
Susilo Saja
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i do things like this :
ObjectInputStream reader = new ObjectInputStream (new GZIPInputStream (new FileInputStream ("wooo2.dat")));
or
FileInputStream fis = new FileInputStream ("wooo2.dat");
GZIPInputStream gis = new GZIPInputStream(fis);
ObjectInputStream reader = new ObjectInputStream (gis);
Then I write this:
reader.close();
Will it close all those 3 streams?
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling close releases any resources associated with the stream, so I'd say that all those other stream resources that the object stream is eventually wrapped around will be closed, also.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!