public class SdkFilterInputStream extends FilterInputStream implements Releasable
FilterInputStream.in| 限定符 | 构造器和说明 |
|---|---|
protected |
SdkFilterInputStream(InputStream in) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort()
Can be used to provide abortion logic prior to throwing the
AbortedException.
|
protected void |
abortIfNeeded()
Aborts with subclass specific abortion logic executed if needed.
|
int |
available() |
void |
close() |
protected boolean |
isAborted() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
release()
Releases the allocated resource.
|
void |
reset() |
long |
skip(long n) |
readprotected SdkFilterInputStream(InputStream in)
protected final void abortIfNeeded()
AbortedException - if found necessary.public void abort()
InputStream is also an instance
of this class, then it will also be aborted, otherwise this is a no-op.protected boolean isAborted()
public int read()
throws IOException
read 在类中 FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在类中 FilterInputStreamIOExceptionpublic long skip(long n)
throws IOException
skip 在类中 FilterInputStreamIOExceptionpublic int available()
throws IOException
available 在类中 FilterInputStreamIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 FilterInputStreamIOExceptionpublic void mark(int readlimit)
mark 在类中 FilterInputStreampublic void reset()
throws IOException
reset 在类中 FilterInputStreamIOExceptionpublic boolean markSupported()
markSupported 在类中 FilterInputStreampublic void release()
ReleasableCloseable resource to be not
unintentionally released owing to the calling of the
Closeable.close() methods by implementation deep down in the call
stack.
For example, the creation of a ResettableInputStream would entail
physically opening a file. If the opened file is meant to be closed only
(in a finally block) by the very same code block that created it, then it
is necessary that the release method must not be called while the
execution is made in other stack frames.
In such case, as other stack frames may inadvertently or indirectly call
the close method of the stream, the creator of the stream would need to
explicitly disable the accidental closing via
ResettableInputStream#disableClose(), so that the release method
becomes the only way to truly close the opened file.
release 在接口中 ReleasableCopyright © 2022. All rights reserved.