org.shiftone.jrat.util.io
Class OpenInputStream
java.lang.Object
java.io.InputStream
org.shiftone.jrat.util.io.proxy.ProxyInputStream
org.shiftone.jrat.util.io.OpenInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class OpenInputStream
- extends ProxyInputStream
Class OpenInputStream wrapps/proxies to a real InputStream and prevents the
caller from closing the underlying input stream. This is useful when reading
chunks from a ZipInputStream passing the archive entry inputStreams to code
that calls close(). This would typically close the entire ZipInputStream,
which would prevent any other archive entries from being read.
- Author:
- jeff@shiftone.org (Jeff Drost)
Method Summary |
void |
assertOpen()
|
void |
close()
Method close does not call close() on the underlying input stream. |
protected java.io.InputStream |
getTarget()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OpenInputStream
public OpenInputStream(java.io.InputStream inputStream)
getTarget
protected java.io.InputStream getTarget()
throws java.io.IOException
- Specified by:
getTarget
in class ProxyInputStream
- Throws:
java.io.IOException
assertOpen
public void assertOpen()
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Method close does not call close() on the underlying input stream. It
set's a flag that is used assertions in the read methods of this class.
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class ProxyInputStream
- Throws:
java.io.IOException