public final class ResponseInputStream<ResponseT> extends SdkFilterInputStream implements Abortable
Note about the Apache http client: This input stream can be used to leverage a feature of the Apache http client where
connections are released back to the connection pool to be reused. As such, calling close
on this input stream will result in reading the remaining data from the stream and leaving the connection open, even if the
stream was only partially read from. For large http payload, this means reading all of the http body before releasing
the connection which may add latency.
If it is not desired to read remaining data from the stream, you can explicitly abort the connection via abort()
instead. This will close the underlying connection and require establishing a new HTTP connection on subsequent requests which
may outweigh the cost of reading the additional data.
The Url Connection and Crt http clients are not subject to this behaviour so the close and
abort methods will behave similarly with them.
in| Constructor and Description |
|---|
ResponseInputStream(ResponseT resp,
AbortableInputStream in) |
ResponseInputStream(ResponseT resp,
InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Close the underlying connection, dropping all remaining data in the stream, and not leaving the
connection open to be used for future requests.
|
ResponseT |
response() |
abortIfNeeded, available, close, mark, markSupported, read, read, release, reset, skipreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreleasepublic ResponseInputStream(ResponseT resp, AbortableInputStream in)
public ResponseInputStream(ResponseT resp, InputStream in)
public ResponseT response()
public void abort()
abort in interface Abortableabort in class SdkFilterInputStreamCopyright © 2026. All rights reserved.