Class TypedBytesContentReader
- java.lang.Object
-
- org.apache.qpid.server.typedmessage.TypedBytesContentReader
-
- All Implemented Interfaces:
TypedBytesCodes
public class TypedBytesContentReader extends Object implements TypedBytesCodes
-
-
Field Summary
-
Fields inherited from interface org.apache.qpid.server.typedmessage.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 Summary
Constructors Constructor Description TypedBytesContentReader(ByteBuffer data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAvailable(int len)
Check that there is at least a certain number of bytes available to readByteBuffer
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 streamchar
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()
-
-
-
Constructor Detail
-
TypedBytesContentReader
public TypedBytesContentReader(ByteBuffer data)
-
-
Method Detail
-
checkAvailable
public void checkAvailable(int len) throws EOFException
Check that there is at least a certain number of bytes available to read- Parameters:
len
- the number of bytes- Throws:
EOFException
- if there are less than len bytes available to read
-
readWireType
public byte readWireType() throws TypedBytesFormatException, EOFException
-
readBoolean
public boolean readBoolean() throws EOFException, TypedBytesFormatException
-
readBooleanImpl
public boolean readBooleanImpl()
-
readByte
public byte readByte() throws EOFException, TypedBytesFormatException
-
readByteImpl
public byte readByteImpl()
-
readShort
public short readShort() throws EOFException, TypedBytesFormatException
-
readShortImpl
public short readShortImpl()
-
readChar
public char readChar() throws EOFException, TypedBytesFormatException
Note that this method reads a unicode character as two bytes from the stream- Returns:
- the character read from the stream
- Throws:
EOFException
- if there are less than the required bytes available to readTypedBytesFormatException
- if the current write type is not compatible
-
readCharImpl
public char readCharImpl()
-
readInt
public int readInt() throws EOFException, TypedBytesFormatException
-
readIntImpl
public int readIntImpl()
-
readLong
public long readLong() throws EOFException, TypedBytesFormatException
-
readLongImpl
public long readLongImpl()
-
readFloat
public float readFloat() throws EOFException, TypedBytesFormatException
-
readFloatImpl
public float readFloatImpl()
-
readDouble
public double readDouble() throws TypedBytesFormatException, EOFException
-
readDoubleImpl
public double readDoubleImpl()
-
readString
public String readString() throws EOFException, TypedBytesFormatException
-
readStringImpl
public String readStringImpl() throws TypedBytesFormatException
- Throws:
TypedBytesFormatException
-
readBytes
public int readBytes(byte[] bytes) throws EOFException, TypedBytesFormatException
-
readObject
public Object readObject() throws EOFException, TypedBytesFormatException
-
reset
public void reset()
-
getData
public ByteBuffer getData()
-
size
public long size()
-
remaining
public int remaining()
-
readRawBytes
public void readRawBytes(byte[] bytes, int offset, int count)
-
readLengthPrefixedUTF
public String readLengthPrefixedUTF() throws TypedBytesFormatException
- Throws:
TypedBytesFormatException
-
-