Package software.amazon.awssdk.utils
Class CancellableOutputStream
java.lang.Object
java.io.OutputStream
software.amazon.awssdk.utils.CancellableOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Direct Known Subclasses:
OutputStreamPublisher
An implementation of
OutputStream
to which writing can be cancel()
ed.
Cancelling tells the downstream receiver of the output that the stream will not be written to anymore, and that the
data sent was incomplete. The stream must still be OutputStream.close()
d by the caller.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
CancellableOutputStream
public CancellableOutputStream()
-
-
Method Details
-
cancel
public abstract void cancel()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.
-