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 aPublisher
to 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 void
cancel()
Cancel writing to the stream.void
close()
void
flush()
void
subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
-
-
-
Method Detail
-
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
public void subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<ByteBuffer>
-
-