@NotThreadSafe public class ReleasableInputStream extends SdkFilterInputStream implements Releasable
disableClose().
The creator of this input stream should therefore always call
release() in a finally block to truly release the underlying
resources.
Releasable,
ResettableInputStream| Modifier and Type | Method and Description |
|---|---|
void |
close()
If
closeDisabled is false, closes this input stream and releases
any system resources associated with the stream. |
<T extends ReleasableInputStream> |
disableClose()
Used to disable the close method.
|
boolean |
isCloseDisabled()
Returns true if the close method has been disabled; false otherwise.
|
void |
release()
Closes the underlying stream file and releases any system resources associated.
|
static ReleasableInputStream |
wrap(InputStream is)
Wraps the given input stream into a
ReleasableInputStream if
necessary. |
abort, available, getDelegateStream, isMetricActivated, mark, markSupported, read, read, reset, skipreadpublic final void close()
closeDisabled is false, closes this input stream and releases
any system resources associated with the stream. Otherwise, this method
does nothing.close in interface Closeableclose in interface AutoCloseableclose in class SdkFilterInputStreampublic final void release()
release in interface Releasablerelease in class SdkFilterInputStreampublic final boolean isCloseDisabled()
release().public final <T extends ReleasableInputStream> T disableClose()
release().public static ReleasableInputStream wrap(InputStream is)
ReleasableInputStream if
necessary. Note if the given input stream is a FileInputStream, a
ResettableInputStream which is a specific subclass of
ReleasableInputStream will be returned.