public class BytesStreamOutput extends org.elasticsearch.common.io.stream.StreamOutput implements org.elasticsearch.common.io.BytesStream
Modifier and Type | Field and Description |
---|---|
protected org.elasticsearch.common.util.BigArrays |
bigarrays |
protected org.elasticsearch.common.util.ByteArray |
bytes |
protected int |
count |
Modifier | Constructor and Description |
---|---|
|
BytesStreamOutput()
Create a non recycling
BytesStreamOutput with 1 initial page acquired. |
|
BytesStreamOutput(int expectedSize)
Create a non recycling
BytesStreamOutput with enough initial pages acquired
to satisfy the capacity given by expected size. |
protected |
BytesStreamOutput(int expectedSize,
org.elasticsearch.common.util.BigArrays bigarrays) |
Modifier and Type | Method and Description |
---|---|
org.elasticsearch.common.bytes.BytesReference |
bytes() |
void |
close() |
void |
flush() |
BytesReference |
ourBytes() |
long |
position() |
void |
reset() |
void |
seek(long position) |
boolean |
seekPositionSupported() |
int |
size()
Returns the current size of the buffer.
|
void |
skip(int length) |
void |
writeByte(byte b) |
void |
writeBytes(byte[] b,
int offset,
int length) |
getVersion, setVersion, write, write, writeBoolean, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeDouble, writeDoubleArray, writeFloat, writeFloatArray, writeGenericValue, writeInt, writeIntArray, writeLong, writeLongArray, writeMap, writeOptionalBoolean, writeOptionalSharedString, writeOptionalStreamable, writeOptionalString, writeOptionalText, writeSharedString, writeSharedText, writeShort, writeString, writeStringArray, writeStringArrayNullable, writeText, writeTextArray, writeVInt, writeVLong
write
protected final org.elasticsearch.common.util.BigArrays bigarrays
protected org.elasticsearch.common.util.ByteArray bytes
protected int count
public BytesStreamOutput()
BytesStreamOutput
with 1 initial page acquired.public BytesStreamOutput(int expectedSize)
BytesStreamOutput
with enough initial pages acquired
to satisfy the capacity given by expected size.expectedSize
- the expected maximum size of the stream in bytes.protected BytesStreamOutput(int expectedSize, org.elasticsearch.common.util.BigArrays bigarrays)
public boolean seekPositionSupported()
seekPositionSupported
in class org.elasticsearch.common.io.stream.StreamOutput
public long position() throws IOException
position
in class org.elasticsearch.common.io.stream.StreamOutput
IOException
public void writeByte(byte b) throws IOException
writeByte
in class org.elasticsearch.common.io.stream.StreamOutput
IOException
public void writeBytes(byte[] b, int offset, int length) throws IOException
writeBytes
in class org.elasticsearch.common.io.stream.StreamOutput
IOException
public void reset()
reset
in class org.elasticsearch.common.io.stream.StreamOutput
public void flush() throws IOException
flush
in interface Flushable
flush
in class org.elasticsearch.common.io.stream.StreamOutput
IOException
public void seek(long position) throws IOException
seek
in class org.elasticsearch.common.io.stream.StreamOutput
IOException
public void skip(int length)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class org.elasticsearch.common.io.stream.StreamOutput
IOException
public int size()
count
field, which is the number of valid
bytes in this output stream.ByteArrayOutputStream.count
public org.elasticsearch.common.bytes.BytesReference bytes()
bytes
in interface org.elasticsearch.common.io.BytesStream
public BytesReference ourBytes()
Copyright © 2012–2014. All rights reserved.