public class TypedBytesContentReader extends Object implements TypedBytesCodes
BOOLEAN_TYPE, BYTE_TYPE, BYTEARRAY_TYPE, CHAR_TYPE, DOUBLE_TYPE, FLOAT_TYPE, INT_TYPE, LONG_TYPE, NULL_STRING_TYPE, SHORT_TYPE, STRING_TYPE
Constructor and Description |
---|
TypedBytesContentReader(ByteBuffer data) |
Modifier and Type | Method and Description |
---|---|
void |
checkAvailable(int len)
Check that there is at least a certain number of bytes available to read
|
ByteBuffer |
getData() |
boolean |
readBoolean() |
boolean |
readBooleanImpl() |
byte |
readByte() |
byte |
readByteImpl() |
int |
readBytes(byte[] bytes) |
char |
readChar()
Note that this method reads a unicode character as two bytes from the stream
|
char |
readCharImpl() |
double |
readDouble() |
double |
readDoubleImpl() |
float |
readFloat() |
float |
readFloatImpl() |
int |
readInt() |
int |
readIntImpl() |
String |
readLengthPrefixedUTF() |
long |
readLong() |
long |
readLongImpl() |
Object |
readObject() |
void |
readRawBytes(byte[] bytes,
int offset,
int count) |
short |
readShort() |
short |
readShortImpl() |
String |
readString() |
String |
readStringImpl() |
byte |
readWireType() |
int |
remaining() |
void |
reset() |
long |
size() |
public TypedBytesContentReader(ByteBuffer data)
public void checkAvailable(int len) throws EOFException
len
- the number of bytesEOFException
- if there are less than len bytes available to readpublic byte readWireType() throws TypedBytesFormatException, EOFException
public boolean readBoolean() throws EOFException, TypedBytesFormatException
public boolean readBooleanImpl()
public byte readByte() throws EOFException, TypedBytesFormatException
public byte readByteImpl()
public short readShort() throws EOFException, TypedBytesFormatException
public short readShortImpl()
public char readChar() throws EOFException, TypedBytesFormatException
EOFException
- if there are less than the required bytes available to readTypedBytesFormatException
- if the current write type is not compatiblepublic char readCharImpl()
public int readInt() throws EOFException, TypedBytesFormatException
public int readIntImpl()
public long readLong() throws EOFException, TypedBytesFormatException
public long readLongImpl()
public float readFloat() throws EOFException, TypedBytesFormatException
public float readFloatImpl()
public double readDouble() throws TypedBytesFormatException, EOFException
public double readDoubleImpl()
public String readString() throws EOFException, TypedBytesFormatException
public String readStringImpl() throws TypedBytesFormatException
TypedBytesFormatException
public int readBytes(byte[] bytes) throws EOFException, TypedBytesFormatException
public Object readObject() throws EOFException, TypedBytesFormatException
public void reset()
public ByteBuffer getData()
public long size()
public int remaining()
public void readRawBytes(byte[] bytes, int offset, int count)
public String readLengthPrefixedUTF() throws TypedBytesFormatException
TypedBytesFormatException
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.