public class S3ObjectInputStream
extends com.amazonaws.internal.SdkFilterInputStream
S3Object
. In addition to
the methods supplied by the InputStream
class,
S3ObjectInputStream
supplies the abort() method, which will terminate
an HTTP connection to the S3 object.Constructor and Description |
---|
S3ObjectInputStream(java.io.InputStream in) |
S3ObjectInputStream(java.io.InputStream in,
org.apache.http.client.methods.HttpRequestBase httpRequest)
Deprecated.
|
S3ObjectInputStream(java.io.InputStream in,
org.apache.http.client.methods.HttpRequestBase httpRequest,
boolean collectMetrics)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Can be used to provide abortion logic prior to throwing the
AbortedException.
|
int |
available()
Returns the value of super.available() if the result is nonzero, or 1
otherwise.
|
org.apache.http.client.methods.HttpRequestBase |
getHttpRequest()
Deprecated.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
public S3ObjectInputStream(java.io.InputStream in)
@Deprecated public S3ObjectInputStream(java.io.InputStream in, org.apache.http.client.methods.HttpRequestBase httpRequest)
@Deprecated public S3ObjectInputStream(java.io.InputStream in, org.apache.http.client.methods.HttpRequestBase httpRequest, boolean collectMetrics)
public void abort()
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 s3 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 S3.
abort
in class com.amazonaws.internal.SdkFilterInputStream
EofSensorInputStream
@Deprecated public org.apache.http.client.methods.HttpRequestBase getHttpRequest()
public int available() throws java.io.IOException
This is necessary to work around a known bug in GZIPInputStream.available(), which returns zero in some edge cases, causing file truncation.
Ref: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7036144
available
in class com.amazonaws.internal.SdkFilterInputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class com.amazonaws.internal.SdkFilterInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class com.amazonaws.internal.SdkFilterInputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class com.amazonaws.internal.SdkFilterInputStream
java.io.IOException
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.