org.knime.core.data.util
Class NonClosableOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.knime.core.data.util.NonClosableOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
NonClosableOutputStream.Zip

public class NonClosableOutputStream
extends OutputStream

Class that overrides the close method and flushes the stream instead of closing it.

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
static class NonClosableOutputStream.Zip
          Special implementation that wraps ZipOutputStream objects and calls ZipOutputStream.closeEntry() when the stream is closed.
 
Constructor Summary
NonClosableOutputStream(OutputStream out)
          Inits object, references argument.
 
Method Summary
 void close()
          
 void flush()
          
(package private)  OutputStream getUnderlyingStream()
          Get reference to underlying stream.
 void write(byte[] b)
          
 void write(byte[] b, int off, int len)
          
 void write(int b)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonClosableOutputStream

public NonClosableOutputStream(OutputStream out)
Inits object, references argument.

Parameters:
out - The reference.
Method Detail

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException

Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException

Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(int b)
           throws IOException

Specified by:
write in class OutputStream
Throws:
IOException

getUnderlyingStream

final OutputStream getUnderlyingStream()
Get reference to underlying stream.

Returns:
The delegated stream.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.