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:
Closeable,Flushable,AutoCloseable,org.elasticsearch.core.Releasable
public class ReleasableBytesStreamOutput
extends BytesStreamOutput
implements org.elasticsearch.core.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.
-
Field Summary
Fields inherited from class org.elasticsearch.common.io.stream.BytesStreamOutput
bigArrays, bytes, count -
Constructor Summary
ConstructorsConstructorDescriptionReleasableBytesStreamOutput(int expectedSize, BigArrays bigArrays)ReleasableBytesStreamOutput(BigArrays bigarrays) -
Method Summary
Methods inherited from class org.elasticsearch.common.io.stream.BytesStreamOutput
bytes, copyBytes, flush, position, ramBytesUsed, seek, size, skip, writeByte, writeBytesMethods inherited from class org.elasticsearch.common.io.stream.StreamOutput
checkWriteable, 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, writeMap, writeMap, writeMapOfLists, writeMapWithConsistentOrder, writeNamedWriteable, writeNamedWriteableList, writeOptionalArray, writeOptionalArray, writeOptionalBoolean, writeOptionalBytesReference, writeOptionalDouble, writeOptionalEnum, 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, writeZoneIdMethods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
ReleasableBytesStreamOutput
-
ReleasableBytesStreamOutput
-
-
Method Details
-
close
public void close()Description copied from class:StreamOutputCloses this stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable- Overrides:
closein classBytesStreamOutput
-
reset
public void reset()- Overrides:
resetin classBytesStreamOutput
-