|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ejdb.bson.io.InputBuffer
public class InputBuffer
Utility class for reading BSON object data from byte array
Method Summary | |
---|---|
static InputBuffer |
createFromByteArray(byte[] data)
Creates InputBuffer from byte array |
protected void |
ensure(int size)
Checks is buffer contains needed bytes |
boolean |
isAvailable()
Returns true if any bytes available to read from buffer or false otherwise |
byte |
read()
Reads one byte from buffer |
byte[] |
readBytes(int count)
Reads bytes from buffer |
int |
readInt()
Reads 4 bytes from buffer as integer value |
long |
readLong()
Reads 8 bytes from buffer as long value |
java.lang.String |
readString()
Reads c-string (null-terminated) from buffer |
java.lang.String |
readString(int length)
Reads c-string from buffer with specified length |
InputBuffer |
subBuffer(int limit)
Get sub buffer with specified length |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public byte read()
public int readInt()
public long readLong()
public byte[] readBytes(int count)
count
- count of bytes to readpublic java.lang.String readString()
public java.lang.String readString(int length)
public boolean isAvailable()
true
if any bytes available to read from buffer or false
otherwise
true
if any bytes available to read from buffer or false
otherwisepublic InputBuffer subBuffer(int limit)
protected void ensure(int size)
public static InputBuffer createFromByteArray(byte[] data)
InputBuffer
from byte array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |