Class OutputStreamPublisher
- java.lang.Object
-
- java.io.OutputStream
-
- software.amazon.awssdk.utils.CancellableOutputStream
-
- software.amazon.awssdk.utils.async.OutputStreamPublisher
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,org.reactivestreams.Publisher<ByteBuffer>
@SdkProtectedApi public final class OutputStreamPublisher extends CancellableOutputStream implements org.reactivestreams.Publisher<ByteBuffer>
Adapts aPublisherto anOutputStream.Writes to the stream will block until demand is available in the downstream subscriber.
-
-
Constructor Summary
Constructors Constructor Description OutputStreamPublisher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel writing to the stream.voidclose()voidflush()voidsubscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Method Detail
-
write
public void write(int b)
- Specified by:
writein classOutputStream
-
write
public void write(byte[] b)
- Overrides:
writein classOutputStream
-
write
public void write(byte[] b, int off, int len)- Overrides:
writein classOutputStream
-
flush
public void flush()
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
cancel
public void cancel()
Description copied from class:CancellableOutputStreamCancel writing to the stream. This is different thanOutputStream.close()in that it indicates the data written so far is truncated and incomplete. Callers must still invokeOutputStream.close()even if the stream is cancelled.- Specified by:
cancelin classCancellableOutputStream
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
subscribe
public void subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
- Specified by:
subscribein interfaceorg.reactivestreams.Publisher<ByteBuffer>
-
-