Package software.amazon.awssdk.core
Class ResponseInputStream<ResponseT>
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- software.amazon.awssdk.core.io.SdkFilterInputStream
-
- software.amazon.awssdk.core.ResponseInputStream<ResponseT>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Releasable
,Abortable
public final class ResponseInputStream<ResponseT> extends SdkFilterInputStream implements Abortable
Input stream that provides access to the unmarshalled POJO response returned by the service in addition to the streamed contents. This input stream should be closed to release the underlying connection back to the connection pool.If it is not desired to read remaining data from the stream, you can explicitly abort the connection via
abort()
. Note that this will close the underlying connection and require establishing an HTTP connection which may outweigh the cost of reading the additional data.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description ResponseInputStream(ResponseT resp, InputStream in)
ResponseInputStream(ResponseT resp, AbortableInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Can be used to provide abortion logic prior to throwing the AbortedException.ResponseT
response()
-
Methods inherited from class software.amazon.awssdk.core.io.SdkFilterInputStream
abortIfNeeded, available, close, mark, markSupported, read, read, release, reset, skip
-
Methods inherited from class java.io.FilterInputStream
read
-
-
-
-
Constructor Detail
-
ResponseInputStream
public ResponseInputStream(ResponseT resp, AbortableInputStream in)
-
ResponseInputStream
public ResponseInputStream(ResponseT resp, InputStream in)
-
-
Method Detail
-
response
public ResponseT response()
- Returns:
- The unmarshalled POJO response associated with this content.
-
abort
public void abort()
Description copied from class:SdkFilterInputStream
Can be used to provide abortion logic prior to throwing the AbortedException. No-op by default.- Specified by:
abort
in interfaceAbortable
- Overrides:
abort
in classSdkFilterInputStream
-
-