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>
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
-
Method Summary
-
Constructor Details
-
OutputStreamPublisher
public OutputStreamPublisher()
-
-
Method Details
-
write
public void write(int b) - Specified by:
write
in classOutputStream
-
write
public void write(byte[] b) - Overrides:
write
in classOutputStream
-
write
public void write(byte[] b, int off, int len) - Overrides:
write
in classOutputStream
-
flush
public void flush()- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
-
cancel
public void cancel()Description copied from class:CancellableOutputStream
Cancel 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:
cancel
in classCancellableOutputStream
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
-
subscribe
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<ByteBuffer>
-