public class COSObjectInputStream extends SdkFilterInputStream
COSObject. In addition to
the methods supplied by the InputStream class,
COSObjectInputStream supplies the abort() method, which will terminate
an HTTP connection to the COS object.in| 构造器和说明 |
|---|
COSObjectInputStream(InputStream in,
org.apache.http.client.methods.HttpRequestBase httpRequest) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort()
Can be used to provide abortion logic prior to throwing the
AbortedException.
|
int |
available()
Returns super.available() if the value is not zero or else always returns
1.
|
void |
close()
Delegate to
abort() if there is data remaining in the stream. |
org.apache.http.client.methods.HttpRequestBase |
getHttpRequest()
Returns the http request from which this input stream is derived.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
abortIfNeeded, isAborted, mark, markSupported, release, skippublic COSObjectInputStream(InputStream in, org.apache.http.client.methods.HttpRequestBase httpRequest)
public void abort()
InputStream is also an instance
of this class, then it will also be aborted, otherwise this is a no-op.
Aborts the underlying http request without reading any more data and
closes the stream.
By default Apache HttpClient tries to reuse http connections by
reading to the end of an attached input stream on
InputStream.close(). This is efficient from a socket pool
management perspective, but for objects with large payloads can incur
significant overhead while bytes are read from COS and discarded. It's up
to clients to decide when to take the performance hit implicit in not
reusing an http connection in order to not read unnecessary information
from COS.
abort 在类中 SdkFilterInputStreamEofSensorInputStreampublic org.apache.http.client.methods.HttpRequestBase getHttpRequest()
public int available()
throws IOException
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7036144
Reference TT: 0034867351
available 在类中 SdkFilterInputStreamIOExceptionpublic int read()
throws IOException
read 在类中 SdkFilterInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read 在类中 FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在类中 SdkFilterInputStreamIOExceptionpublic void reset()
throws IOException
reset 在类中 SdkFilterInputStreamIOExceptionpublic void close()
throws IOException
abort() if there is data remaining in the stream. If the stream has been
read completely, with no data remaining, safely close the stream.close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 SdkFilterInputStreamIOExceptionCOSObjectInputStream#abort()}Copyright © 2021. All rights reserved.