Class AbortableInputStreamSubscriber
java.lang.Object
java.io.InputStream
software.amazon.awssdk.http.async.AbortableInputStreamSubscriber
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.reactivestreams.Subscriber<ByteBuffer>
,Abortable
public final class AbortableInputStreamSubscriber
extends InputStream
implements org.reactivestreams.Subscriber<ByteBuffer>, Abortable
Wrapper of
InputStreamSubscriber
that also implements Abortable
. It will invoke close()
when abort()
is invoked. Upon closing, the underlying InputStreamSubscriber
will be closed, and additional
action can be added via AbortableInputStreamSubscriber.Builder.doAfterClose(Runnable)
.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Aborts the execution of the task.builder()
void
close()
void
void
void
onNext
(ByteBuffer byteBuffer) void
onSubscribe
(org.reactivestreams.Subscription s) int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
-
Method Details
-
builder
-
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. -
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s) - Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onNext
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onError
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-