public class ReleasableBytesStreamOutput extends BytesStreamOutput implements Releasable
BigArrays
instance
expecting it to require releasing its content (bytes()
) once done.
Please note, closing this stream will release the bytes that are in use by any
ReleasablePagedBytesReference
returned from bytes()
, so this
stream should only be closed after the bytes have been output or copied
elsewhere.
bigArrays, bytes, count
Constructor and Description |
---|
ReleasableBytesStreamOutput(BigArrays bigarrays) |
ReleasableBytesStreamOutput(int expectedSize,
BigArrays bigArrays) |
Modifier and Type | Method and Description |
---|---|
ReleasablePagedBytesReference |
bytes()
Returns a
Releasable implementation of a
BytesReference that represents the current state of
the bytes in the stream. |
void |
close()
Closes this stream to further operations.
|
void |
reset() |
flush, position, ramBytesUsed, seek, size, skip, writeByte, writeBytes
getVersion, setVersion, write, write, writeArray, writeBoolean, writeByteArray, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeDouble, writeDoubleArray, writeEnum, writeException, writeFloat, writeFloatArray, writeGenericValue, writeGeoPoint, writeInt, writeIntArray, writeList, writeLong, writeLongArray, writeMap, writeMap, writeMapOfLists, writeMapWithConsistentOrder, writeNamedWriteable, writeNamedWriteableList, writeOptionalArray, writeOptionalBoolean, writeOptionalBytesReference, writeOptionalDouble, writeOptionalFloat, writeOptionalLong, writeOptionalNamedWriteable, writeOptionalStreamable, writeOptionalString, writeOptionalStringArray, writeOptionalText, writeOptionalTimeZone, writeOptionalVInt, writeOptionalWriteable, writeShort, writeStreamableList, writeString, writeStringArray, writeStringArrayNullable, writeStringList, writeText, writeTimeZone, writeVInt, writeVIntArray, writeVLong, writeVLongArray, writeZLong
public ReleasableBytesStreamOutput(BigArrays bigarrays)
public ReleasableBytesStreamOutput(int expectedSize, BigArrays bigArrays)
public ReleasablePagedBytesReference bytes()
Releasable
implementation of a
BytesReference
that represents the current state of
the bytes in the stream.bytes
in class BytesStreamOutput
public void close()
StreamOutput
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Releasable
close
in class BytesStreamOutput
public void reset()
reset
in class BytesStreamOutput