Class ReleasableBytesStreamOutput

All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, Releasable

public class ReleasableBytesStreamOutput extends BytesStreamOutput implements Releasable
An bytes stream output that allows providing a BigArrays instance expecting it to require releasing its content (BytesStreamOutput.bytes()) once done.

Please note, closing this stream will release the bytes that are in use by any ReleasableBytesReference returned from BytesStreamOutput.bytes(), so this stream should only be closed after the bytes have been output or copied elsewhere.