Streams question



Hi -

Is it safe/acceptable to build nested stream objects? If I nest a
FileInputStream inside a BufferInputStream for example, will this create
close() issues?

i.e.
InputStream myStream = new BufferedInputStream(new FileInputStream(myFile));
myStream.close();

-- versus --
InputStream fileStream = new FileInputStream(myFile);
InputStream bufStream = new BufferedInputStream(fileStream);
bufStream.close();
fileStream.close();

Is there a difference between these pieces of code?

Thanks,
Brian


.