public class CloseIgnoringInputStream extends FilterInputStream
InputStream wrapper whose close() does nothing.
This is useful with raw decompressors if you want to call
close() to release memory allocated from an ArrayCache
but don't want to close the underlying InputStream.
For example:
InputStream rawdec = new LZMA2InputStream(
new CloseIgnoringInputStream(myInputStream),
myDictSize, null, myArrayCache);
doSomething(rawdec);
rawdec.close(); // This doesn't close myInputStream.
With XZInputStream, SingleXZInputStream, and
SeekableXZInputStream you can use their close(boolean)
method to avoid closing the underlying InputStream; with
those classes CloseIgnoringInputStream isn't needed.
in| Constructor and Description |
|---|
CloseIgnoringInputStream(InputStream in)
Creates a new
CloseIgnoringInputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This does nothing (doesn't call
in.close()). |
available, mark, markSupported, read, read, read, reset, skippublic CloseIgnoringInputStream(InputStream in)
CloseIgnoringInputStream.public void close()
in.close()).close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStream