org.pentaho.reporting.engine.classic.core.util
Class NoCloseOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.pentaho.reporting.engine.classic.core.util.NoCloseOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class NoCloseOutputStream
extends FilterOutputStream

A Wrapper stream that does never calls close on its parent. This implementation is needed when creating ZipOutputStream, as the final ZipDirectory is written when close is called on the ZipOutputSteam.

Author:
Thomas Morgner

Constructor Summary
NoCloseOutputStream(OutputStream out)
          Create a new NoCloseOutputStream with the given output stream a parent.
 
Method Summary
 void close()
          Closes this output stream and releases any system resources associated with the stream, but does not close the underlying output stream.
 
Methods inherited from class java.io.FilterOutputStream
flush, write, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoCloseOutputStream

public NoCloseOutputStream(OutputStream out)
Create a new NoCloseOutputStream with the given output stream a parent.

Parameters:
out - the parent stream
Method Detail

close

public void close()
           throws IOException
Closes this output stream and releases any system resources associated with the stream, but does not close the underlying output stream.

The close method of FilterOutputStream calls its flush method.

Specified by:
close in interface Closeable
Overrides:
close in class FilterOutputStream
Throws:
IOException - if an I/O error occurs.
See Also:
FilterOutputStream.flush(), FilterOutputStream.out