public class BytesStreamOutput extends StreamOutput implements BytesStream
StreamOutput that uses BigArrays to acquire pages of
bytes, which avoids frequent reallocation & copying of the internal data.| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected BigArrays |
bigarrays |
protected ByteArray |
bytes |
protected int |
count |
| 修飾子 | コンストラクタと説明 |
|---|---|
|
BytesStreamOutput()
Create a non recycling
BytesStreamOutput with an initial capacity of 0. |
|
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,
BigArrays bigarrays) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
BytesReference |
bytes() |
void |
close()
Closes this stream to further operations.
|
void |
flush()
Forces any buffered output to be written.
|
long |
position() |
long |
ramBytesUsed()
Returns the number of bytes used by the underlying
ByteArray |
void |
reset() |
void |
seek(long position) |
int |
size()
Returns the current size of the buffer.
|
void |
skip(int length) |
void |
writeByte(byte b)
Writes a single byte.
|
void |
writeBytes(byte[] b,
int offset,
int length)
Writes an array of bytes.
|
getVersion, setVersion, write, write, writeBoolean, writeByteArray, writeBytes, writeBytes, writeBytesRef, writeBytesReference, writeDouble, writeDoubleArray, writeFloat, writeFloatArray, writeGenericValue, writeGeoPoint, writeInt, writeIntArray, writeList, writeLong, writeLongArray, writeMap, writeOptionalBoolean, writeOptionalStreamable, writeOptionalString, writeOptionalText, writeOptionalVInt, writeShort, writeString, writeStringArray, writeStringArrayNullable, writeTaskStatus, writeText, writeThrowable, writeVInt, writeVIntArray, writeVLong, writeVLongArraywriteprotected final BigArrays bigarrays
protected ByteArray bytes
protected int count
public BytesStreamOutput()
BytesStreamOutput with an initial capacity of 0.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,
BigArrays bigarrays)
public long position()
throws IOException
position クラス内 StreamOutputIOExceptionpublic void writeByte(byte b)
throws IOException
StreamOutputwriteByte クラス内 StreamOutputIOExceptionpublic void writeBytes(byte[] b,
int offset,
int length)
throws IOException
StreamOutputwriteBytes クラス内 StreamOutputb - the bytes to writeoffset - the offset in the byte arraylength - the number of bytes to writeIOExceptionpublic void reset()
reset クラス内 StreamOutputpublic void flush()
throws IOException
StreamOutputflush インタフェース内 Flushableflush クラス内 StreamOutputIOExceptionpublic void seek(long position)
throws IOException
seek クラス内 StreamOutputIOExceptionpublic void skip(int length)
public void close()
throws IOException
StreamOutputclose インタフェース内 Closeableclose インタフェース内 AutoCloseableclose クラス内 StreamOutputIOExceptionpublic int size()
count field, which is the number of valid
bytes in this output stream.ByteArrayOutputStream.countpublic BytesReference bytes()
bytes インタフェース内 BytesStreampublic long ramBytesUsed()
ByteArrayAccountable.ramBytesUsed()Copyright © 2009–2016. All rights reserved.