|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.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 | |
---|---|
void |
close()
Closes this stream to further operations. |
byte[] |
copiedByteArray()
Creates a newly allocated byte array. |
void |
flush()
Forces any buffered output to be written. |
void |
reset()
|
void |
seek(int seekTo)
|
int |
size()
Returns the current size of the buffer. |
byte[] |
unsafeByteArray()
Returns the underlying byte array. |
void |
writeByte(byte b)
Writes a single byte. |
void |
writeBytes(byte[] b,
int offset,
int length)
Writes an array of bytes. |
void |
writeUTF(java.lang.String str)
Writes a string. |
Methods inherited from class org.elasticsearch.common.io.stream.StreamOutput |
---|
write, write, writeBoolean, writeBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort, 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 void writeByte(byte b) throws java.io.IOException
StreamOutput
writeByte
in class StreamOutput
java.io.IOException
public void writeBytes(byte[] b, int offset, int length) throws java.io.IOException
StreamOutput
writeBytes
in class StreamOutput
b
- the bytes to writeoffset
- the offset in the byte arraylength
- the number of bytes to write
java.io.IOException
public void seek(int seekTo)
public void reset()
reset
in class StreamOutput
public void flush() throws java.io.IOException
StreamOutput
flush
in interface java.io.Flushable
flush
in class StreamOutput
java.io.IOException
public void close() throws java.io.IOException
StreamOutput
close
in interface java.io.Closeable
close
in class StreamOutput
java.io.IOException
public byte[] copiedByteArray()
copiedByteArray
in interface BytesStream
ByteArrayOutputStream.size()
public byte[] unsafeByteArray()
size()
in order to know
the length of it.
unsafeByteArray
in interface BytesStream
public int size()
size
in interface BytesStream
count
field, which is the number
of valid bytes in this output stream.ByteArrayOutputStream.count
public void writeUTF(java.lang.String str) throws java.io.IOException
writeUTF
in class StreamOutput
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |