Class ReleasableBytesStreamOutput

java.lang.Object
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.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.

  • Constructor Details

    • ReleasableBytesStreamOutput

      public ReleasableBytesStreamOutput​(BigArrays bigarrays)
    • ReleasableBytesStreamOutput

      public ReleasableBytesStreamOutput​(int expectedSize, BigArrays bigArrays)
  • Method Details

    • close

      public void close()
      Description copied from class: StreamOutput
      Closes this stream to further operations.
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Specified by:
      close in interface Releasable
      Overrides:
      close in class BytesStreamOutput