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| 限定符 | 构造器和说明 |
|---|---|
protected |
ReleasableInputStream(java.io.InputStream is)
This constructor is not meant to be used directly.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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(java.io.InputStream is)
Wraps the given input stream into a
ReleasableInputStream if necessary. |
abort, abortIfNeeded, available, isAborted, mark, markSupported, read, read, reset, skipprotected ReleasableInputStream(java.io.InputStream is)
wrap(InputStream) instead.public 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 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableclose 在类中 SdkFilterInputStreamFilterInputStream.inpublic final void release()
release 在接口中 Releasablerelease 在类中 SdkFilterInputStreampublic final boolean isCloseDisabled()
release().public final <T extends ReleasableInputStream> T disableClose()
release().public static ReleasableInputStream wrap(java.io.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.