Package software.amazon.awssdk.http
Class AbortableInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
software.amazon.awssdk.http.AbortableInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Abortable
Input stream that can be aborted. Abort typically means to destroy underlying HTTP connection
without reading more data. This may be desirable when the cost of reading the rest of the data
exceeds that of establishing a new connection.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Aborts the execution of the task.static AbortableInputStream
create
(InputStream delegate) Creates an instance ofAbortableInputStream
that ignores abort.static AbortableInputStream
create
(InputStream delegate, Abortable abortable) Creates an instance ofAbortableInputStream
.static AbortableInputStream
delegate()
Access the underlying delegate stream, for testing purposes.Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
Method Details
-
create
Creates an instance ofAbortableInputStream
.- Parameters:
delegate
- the delegated input streamabortable
- the abortable- Returns:
- a new instance of AbortableInputStream
-
create
Creates an instance ofAbortableInputStream
that ignores abort.- Parameters:
delegate
- the delegated input stream- Returns:
- a new instance of AbortableInputStream
-
createEmpty
-
abort
public void abort()Description copied from interface:Abortable
Aborts the execution of the task. Multiple calls to abort or calling abort an already aborted task should return without error. -
delegate
Access the underlying delegate stream, for testing purposes.
-