Package com.aoindustries.io
Class DontCloseInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.aoindustries.io.DontCloseInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class DontCloseInputStream extends FilterInputStream
Wraps an InputStream to protect it from close calls. This is useful for at least GZIPInputStream where the native resources of the GZIPInputStream need to be released using the close call while the underlying stream is left intact.- Author:
- AO Industries, Inc.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description DontCloseInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Does nothing on close to protect the wrapped InputStream.-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
-
-
-
-
Constructor Detail
-
DontCloseInputStream
public DontCloseInputStream(InputStream in)
-
-
Method Detail
-
close
public void close()
Does nothing on close to protect the wrapped InputStream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream
-
-