Package org.tukaani.xz
Class CloseIgnoringInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.tukaani.xz.CloseIgnoringInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CloseIgnoringInputStream extends FilterInputStream
AnInputStream
wrapper whoseclose()
does nothing. This is useful with raw decompressors if you want to callclose()
to release memory allocated from anArrayCache
but don't want to close the underlyingInputStream
. For example:InputStream rawdec = new LZMA2InputStream( new CloseIgnoringInputStream(myInputStream), myDictSize, null, myArrayCache); doSomething(rawdec); rawdec.close(); // This doesn't close myInputStream.
With
XZInputStream
,SingleXZInputStream
, andSeekableXZInputStream
you can use theirclose(boolean)
method to avoid closing the underlyingInputStream
; with those classesCloseIgnoringInputStream
isn't needed.- Since:
- 1.7
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description CloseIgnoringInputStream(InputStream in)
Creates a newCloseIgnoringInputStream
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This does nothing (doesn't callin.close()
).-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
CloseIgnoringInputStream
public CloseIgnoringInputStream(InputStream in)
Creates a newCloseIgnoringInputStream
.
-
-
Method Detail
-
close
public void close()
This does nothing (doesn't callin.close()
).- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
-
-