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
ConstructorDescriptionReleasableBytesStreamOutput(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, writeBytes
Methods 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, writeZoneId
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
ReleasableBytesStreamOutput
-
ReleasableBytesStreamOutput
-
-
Method Details
-
close
public void close()Description copied from class:StreamOutput
Closes this stream to further operations.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.elasticsearch.core.Releasable
- Overrides:
close
in classBytesStreamOutput
-
reset
public void reset()- Overrides:
reset
in classBytesStreamOutput
-