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, writeVLongwriteprotected 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.StreamOutputpublic long position() throws IOException
position in class org.elasticsearch.common.io.stream.StreamOutputIOExceptionpublic void writeByte(byte b) throws IOException
writeByte in class org.elasticsearch.common.io.stream.StreamOutputIOExceptionpublic void writeBytes(byte[] b, int offset, int length) throws IOException
writeBytes in class org.elasticsearch.common.io.stream.StreamOutputIOExceptionpublic void reset()
reset in class org.elasticsearch.common.io.stream.StreamOutputpublic void flush() throws IOException
flush in interface Flushableflush in class org.elasticsearch.common.io.stream.StreamOutputIOExceptionpublic void seek(long position) throws IOException
seek in class org.elasticsearch.common.io.stream.StreamOutputIOExceptionpublic void skip(int length)
public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.elasticsearch.common.io.stream.StreamOutputIOExceptionpublic int size()
count field, which is the number of valid
bytes in this output stream.ByteArrayOutputStream.countpublic org.elasticsearch.common.bytes.BytesReference bytes()
bytes in interface org.elasticsearch.common.io.BytesStreampublic BytesReference ourBytes()
Copyright © 2012–2014. All rights reserved.