Class InputStreamSubscriber
java.lang.Object
java.io.InputStream
software.amazon.awssdk.utils.async.InputStreamSubscriber
- All Implemented Interfaces:
Closeable,AutoCloseable,org.reactivestreams.Subscriber<ByteBuffer>,SdkAutoCloseable
public final class InputStreamSubscriber
extends InputStream
implements org.reactivestreams.Subscriber<ByteBuffer>, SdkAutoCloseable
Adapts a
Subscriber to a InputStream.
Reads from the stream will block until data is published to this subscriber. The amount of data stored in memory by this subscriber when the input stream is not being read is bounded.
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidvoidonNext(ByteBuffer byteBuffer) voidonSubscribe(org.reactivestreams.Subscription s) intread()intread(byte[] b) intread(byte[] bytes, int off, int len) Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
-
Constructor Details
-
InputStreamSubscriber
public InputStreamSubscriber() -
InputStreamSubscriber
-
-
Method Details
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s) - Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onNext
- Specified by:
onNextin interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onError
- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<ByteBuffer>
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close()Description copied from interface:SdkAutoCloseable- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSdkAutoCloseable- Overrides:
closein classInputStream
-