org.knime.core.data.util
Class NonClosableInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.knime.core.data.util.NonClosableInputStream
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
NonClosableInputStream.Zip

public class NonClosableInputStream
extends InputStream

InputStream that delegates to an underlying InputStream but ignores calls of close().

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
static class NonClosableInputStream.Zip
          Special implementation that wraps ZipInputStream objects and calls ZipInputStream.closeEntry() when the stream is closed.
 
Constructor Summary
NonClosableInputStream(InputStream inStream)
          Creates new input stream.
 
Method Summary
 int available()
          
 void close()
          Does NOT delegate to wrapped input stream, ignores call.
 InputStream getUnderlyingStream()
          Get reference to underlying stream.
 void mark(int readlimit)
          
 boolean markSupported()
          
 int read()
          
 int read(byte[] b)
          
 int read(byte[] b, int off, int len)
          
 void reset()
          
 long skip(long n)
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonClosableInputStream

public NonClosableInputStream(InputStream inStream)
Creates new input stream.

Parameters:
inStream - To wrap.
Throws:
NullPointerException - If the argument is null.
Method Detail

available

public int available()
              throws IOException

Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Does NOT delegate to wrapped input stream, ignores call.

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

mark

public void mark(int readlimit)

Overrides:
mark in class InputStream

markSupported

public boolean markSupported()

Overrides:
markSupported in class InputStream

read

public int read()
         throws IOException

Specified by:
read in class InputStream
Throws:
IOException

read

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

Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException

Overrides:
read in class InputStream
Throws:
IOException

reset

public void reset()
           throws IOException

Overrides:
reset in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException

Overrides:
skip in class InputStream
Throws:
IOException

toString

public String toString()

Overrides:
toString in class Object

getUnderlyingStream

public final InputStream 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.