|
|||||||||
| 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 StreamOutputjava.io.IOException
public void writeBytes(byte[] b,
int offset,
int length)
throws java.io.IOException
StreamOutput
writeBytes in class StreamOutputb - the bytes to writeoffset - the offset in the byte arraylength - the number of bytes to write
java.io.IOExceptionpublic void seek(int seekTo)
public void reset()
reset in class StreamOutput
public void flush()
throws java.io.IOException
StreamOutput
flush in interface java.io.Flushableflush in class StreamOutputjava.io.IOException
public void close()
throws java.io.IOException
StreamOutput
close in interface java.io.Closeableclose in class StreamOutputjava.io.IOExceptionpublic byte[] copiedByteArray()
copiedByteArray in interface BytesStreamByteArrayOutputStream.size()public byte[] unsafeByteArray()
size() in order to know
the length of it.
unsafeByteArray in interface BytesStreampublic int size()
size in interface BytesStreamcount 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 StreamOutputjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||