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