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 a
Publisher to an OutputStream.
Writes to the stream will block until demand is available in the downstream subscriber.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
OutputStreamPublisher
public OutputStreamPublisher()
-
-
Method Details
-
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
- Specified by:
subscribein interfaceorg.reactivestreams.Publisher<ByteBuffer>
-