• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Closing Stream

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic