|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream org.elasticsearch.common.io.stream.StreamOutput org.elasticsearch.common.io.stream.BytesStreamOutput
public class BytesStreamOutput
Field Summary | |
---|---|
protected byte[] |
buf
The buffer where data is stored. |
protected int |
count
The number of valid bytes in the buffer. |
Constructor Summary | |
---|---|
BytesStreamOutput()
|
|
BytesStreamOutput(int size)
|
Method Summary | |
---|---|
BytesReference |
bytes()
|
void |
close()
Closes this stream to further operations. |
void |
flush()
Forces any buffered output to be written. |
long |
position()
|
void |
reset()
|
void |
seek(int seekTo)
|
void |
seek(long position)
|
boolean |
seekPositionSupported()
|
int |
size()
Returns the current size of the buffer. |
void |
writeByte(byte b)
Writes a single byte. |
void |
writeBytes(byte[] b,
int offset,
int length)
Writes an array of bytes. |
Methods inherited from class org.elasticsearch.common.io.stream.StreamOutput |
---|
write, write, writeBoolean, writeBytes, writeBytes, writeBytesReference, writeDouble, writeFloat, writeGenericValue, writeInt, writeLong, writeMap, writeOptionalString, writeOptionalUTF, writeShort, writeString, writeStringArray, writeText, writeUTF, writeVInt, writeVLong |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] buf
protected int count
Constructor Detail |
---|
public BytesStreamOutput()
public BytesStreamOutput(int size)
Method Detail |
---|
public boolean seekPositionSupported()
seekPositionSupported
in class StreamOutput
public long position() throws IOException
position
in class StreamOutput
IOException
public void seek(long position) throws IOException
seek
in class StreamOutput
IOException
public void writeByte(byte b) throws IOException
StreamOutput
writeByte
in class StreamOutput
IOException
public void writeBytes(byte[] b, int offset, int length) throws IOException
StreamOutput
writeBytes
in class StreamOutput
b
- the bytes to writeoffset
- the offset in the byte arraylength
- the number of bytes to write
IOException
public void seek(int seekTo)
public void reset()
reset
in class StreamOutput
public void flush() throws IOException
StreamOutput
flush
in interface Flushable
flush
in class StreamOutput
IOException
public void close() throws IOException
StreamOutput
close
in interface Closeable
close
in class StreamOutput
IOException
public BytesReference bytes()
bytes
in interface BytesStream
public int size()
count
field, which is the number
of valid bytes in this output stream.ByteArrayOutputStream.count
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |