org.freehep.util.io
Class NoCloseOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.BufferedOutputStream
              extended by org.freehep.util.io.NoCloseOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class NoCloseOutputStream
extends BufferedOutputStream

The NoCloseOutputStream ignores the close so that one can keep writing to the underlying stream.

Version:
$Id: NoCloseOutputStream.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Field Summary
 
Fields inherited from class java.io.BufferedOutputStream
buf, count
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
NoCloseOutputStream(OutputStream stream)
          Creates a No Close output stream.
NoCloseOutputStream(OutputStream stream, int size)
          Creates a No Close output stream.
 
Method Summary
 void close()
           
 void realClose()
          Closes the stream (the close method is ignored).
 
Methods inherited from class java.io.BufferedOutputStream
flush, write, write
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoCloseOutputStream

public NoCloseOutputStream(OutputStream stream)
Creates a No Close output stream.

Parameters:
stream - stream to write to

NoCloseOutputStream

public NoCloseOutputStream(OutputStream stream,
                           int size)
Creates a No Close output stream.

Parameters:
stream - stream to write to
size - buffer size
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterOutputStream
Throws:
IOException

realClose

public void realClose()
               throws IOException
Closes the stream (the close method is ignored).

Throws:
IOException - if the close fails


Copyright © 2000-2007 FreeHEP. All Rights Reserved.