Class ReleasableBytesStreamOutput
java.lang.Object
java.io.OutputStream
org.elasticsearch.common.io.stream.StreamOutput
org.elasticsearch.common.io.stream.BytesStream
org.elasticsearch.common.io.stream.BytesStreamOutput
org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput
- 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 (bytes()) once done.
Please note, closing this stream will release the bytes that are in use by any
ReleasableBytesReference returned from bytes(), so this
stream should only be closed after the bytes have been output or copied
elsewhere.
-
Field Summary
Fields inherited from class org.elasticsearch.common.io.stream.BytesStreamOutput
bigArrays, bytes, count -
Constructor Summary
Constructors Constructor Description ReleasableBytesStreamOutput(int expectedSize, BigArrays bigArrays)ReleasableBytesStreamOutput(BigArrays bigarrays) -
Method Summary
Modifier and Type Method Description ReleasableBytesReferencebytes()Returns aReleasableimplementation of aBytesReferencethat represents the current state of the bytes in the stream.voidclose()Closes this stream to further operations.voidreset()Methods inherited from class org.elasticsearch.common.io.stream.BytesStreamOutput
flush, position, ramBytesUsed, seek, size, skip, writeByte, writeBytesMethods inherited from class org.elasticsearch.common.io.stream.StreamOutput
getFeatures, getVersion, hasFeature, setFeatures, setVersion, write, write, writeArray, writeArray, writeBoolean, writeByteArray, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeCollection, writeCollection, writeDouble, writeDoubleArray, writeEnum, writeEnumSet, writeException, writeFloat, writeFloatArray, writeGenericValue, writeGeoPoint, writeInstant, writeInt, writeIntArray, writeList, writeLong, writeLongArray, writeMap, writeMap, writeMapOfLists, writeMapWithConsistentOrder, writeNamedWriteable, writeNamedWriteableList, writeOptionalArray, writeOptionalArray, writeOptionalBoolean, writeOptionalBytesReference, writeOptionalDouble, writeOptionalFloat, writeOptionalInstant, writeOptionalInt, writeOptionalLong, writeOptionalNamedWriteable, writeOptionalSecureString, writeOptionalString, writeOptionalStringArray, writeOptionalStringCollection, writeOptionalText, writeOptionalTimeValue, writeOptionalTimeZone, writeOptionalVInt, writeOptionalVLong, writeOptionalWriteable, writeOptionalZoneId, writeSecureString, writeShort, writeString, writeStringArray, writeStringArrayNullable, writeStringCollection, writeText, writeTimeValue, writeTimeZone, writeVInt, writeVIntArray, writeVLong, writeVLongArray, writeZLong, writeZoneId
-
Constructor Details
-
Method Details
-
bytes
Returns aReleasableimplementation of aBytesReferencethat represents the current state of the bytes in the stream.- Overrides:
bytesin classBytesStreamOutput
-
close
public void close()Description copied from class:StreamOutputCloses this stream to further operations.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceReleasable- Overrides:
closein classBytesStreamOutput
-
reset
public void reset()- Overrides:
resetin classBytesStreamOutput
-