java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.aoapps.lang.io.NoCloseInputStream
- All Implemented Interfaces:
NoClose
,Closeable
,AutoCloseable
Overrides
close()
to a no-op.-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Does not close the wrapped stream.static <I extends InputStream & NoClose>
Iwrap
(InputStream in) Returnsin
when it is already aNoClose
andNoClose.isNoClose()
, otherwise returns a newNoCloseInputStream
wrappingin
.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 Details
-
NoCloseInputStream
Deprecated.Please usewrap(java.io.InputStream)
to skip wrapping when possible.
-
-
Method Details
-
wrap
Returnsin
when it is already aNoClose
andNoClose.isNoClose()
, otherwise returns a newNoCloseInputStream
wrappingin
. -
close
public void close()Does not close the wrapped stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceNoClose
- Overrides:
close
in classFilterInputStream
-
wrap(java.io.InputStream)
to skip wrapping when possible.