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 aBigArraysinstance 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
ReleasablePagedBytesReferencereturned frombytes(), 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 ReleasablePagedBytesReferencebytes()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, writeBytes
-
Methods inherited from class org.elasticsearch.common.io.stream.StreamOutput
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, writeOptionalStreamable, writeOptionalString, writeOptionalStringArray, writeOptionalText, writeOptionalTimeValue, writeOptionalTimeZone, writeOptionalVInt, writeOptionalWriteable, writeOptionalZoneId, writeShort, writeStreamableList, writeString, writeStringArray, writeStringArrayNullable, writeStringCollection, writeText, writeTimeValue, writeTimeZone, writeVInt, writeVIntArray, writeVLong, writeVLongArray, writeZLong, writeZoneId
-
-
-
-
Method Detail
-
bytes
public ReleasablePagedBytesReference 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
-
-