Class AbortableInputStreamSubscriber
- java.lang.Object
-
- java.io.InputStream
-
- software.amazon.awssdk.http.crt.internal.response.AbortableInputStreamSubscriber
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.reactivestreams.Subscriber<ByteBuffer>
,Abortable
public final class AbortableInputStreamSubscriber extends InputStream implements org.reactivestreams.Subscriber<ByteBuffer>, Abortable
Wrapper ofInputStreamSubscriber
that also implementsAbortable
and closes the underlying connections whenclose()
orabort()
is invoked.
-
-
Constructor Summary
Constructors Constructor Description AbortableInputStreamSubscriber(Runnable onClose, InputStreamSubscriber inputStreamSubscriber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
void
close()
void
onComplete()
void
onError(Throwable t)
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
-
-
-
-
Constructor Detail
-
AbortableInputStreamSubscriber
public AbortableInputStreamSubscriber(Runnable onClose, InputStreamSubscriber inputStreamSubscriber)
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onNext
public void onNext(ByteBuffer byteBuffer)
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onError
public void onError(Throwable t)
- 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
-
-