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
public abstract class CancellableOutputStream extends OutputStream
An implementation ofOutputStream
to which writing can becancel()
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
Constructors Constructor Description CancellableOutputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
cancel()
Cancel writing to the stream.
-
-
-
Method Detail
-
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.
-
-