org.apache.qpid.transport.codec
Class BBDecoder

java.lang.Object
  extended by org.apache.qpid.transport.codec.AbstractDecoder
      extended by org.apache.qpid.transport.codec.BBDecoder
All Implemented Interfaces:
Decoder

public final class BBDecoder
extends AbstractDecoder

Byte Buffer Decoder. Decoder concrete implementor using a backing byte buffer for decoding data.


Constructor Summary
BBDecoder()
           
 
Method Summary
protected  byte doGet()
           
protected  void doGet(byte[] bytes)
           
protected  Binary get(int size)
           
 boolean hasRemaining()
          Tells whether there are any remaining byte(s) to be read.
 void init(ByteBuffer in)
           
 byte[] readBin128()
          The bin128 type consists of 16 consecutive octets of opaque binary data.
 byte[] readBytes(int howManyBytes)
          Reads the given number of bytes.
 double readDouble()
          The double type encodes a double precision 64-bit floating point number.
 float readFloat()
          The float type encodes a single precision 32-bit floating point number.
 short readInt16()
          The int16 type is a signed integral value encoded using a 16-bit two's complement representation in network byte order.
 int readInt32()
          The int32 type is a signed integral value encoded using a 32-bit two's complement representation in network byte order.
 long readInt64()
          The int64 type is a signed integral value encoded using a 64-bit two's complement representation in network byte order.
 byte readInt8()
          The int8 type is a signed integral value encoded using an 8-bit two's complement representation.
 byte[] readReaminingBytes()
          Reads the remaining bytes on the underlying buffer.
 int readUint16()
          The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
 long readUint32()
          The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
 long readUint64()
          The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
 short readUint8()
          The uint8 type is an 8-bit unsigned integral value.
 
Methods inherited from class org.apache.qpid.transport.codec.AbstractDecoder
get, get, readArray, readByteRanges, readContent, readDatetime, readList, readMap, readSequenceNo, readSequenceSet, readStr16, readStr8, readStruct, readStruct32, readUuid, readVbin16, readVbin32, readVbin8, uget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BBDecoder

public BBDecoder()
Method Detail

init

public void init(ByteBuffer in)

doGet

protected byte doGet()
Specified by:
doGet in class AbstractDecoder

doGet

protected void doGet(byte[] bytes)
Specified by:
doGet in class AbstractDecoder

get

protected Binary get(int size)
Overrides:
get in class AbstractDecoder

hasRemaining

public boolean hasRemaining()
Description copied from interface: Decoder
Tells whether there are any remaining byte(s) to be read.

Returns:
true if there are remaining bytes, false otherwise.

readUint8

public short readUint8()
Description copied from interface: Decoder
The uint8 type is an 8-bit unsigned integral value.

Specified by:
readUint8 in interface Decoder
Overrides:
readUint8 in class AbstractDecoder
Returns:
an 8-bit unsigned integral value.

readUint16

public int readUint16()
Description copied from interface: Decoder
The uint16 type is a 16-bit unsigned integral value encoded in network byte order.

Specified by:
readUint16 in interface Decoder
Overrides:
readUint16 in class AbstractDecoder
Returns:
a 16-bit unsigned integral value encoded in network byte order.

readUint32

public long readUint32()
Description copied from interface: Decoder
The uint32 type is a 32-bit unsigned integral value encoded in network byte order.

Specified by:
readUint32 in interface Decoder
Overrides:
readUint32 in class AbstractDecoder
Returns:
a 32-bit unsigned integral value encoded in network byte order.

readUint64

public long readUint64()
Description copied from interface: Decoder
The uint64 type is a 64-bit unsigned integral value encoded in network byte order.

Specified by:
readUint64 in interface Decoder
Overrides:
readUint64 in class AbstractDecoder
Returns:
a 64-bit unsigned integral value encoded in network byte order.

readBin128

public byte[] readBin128()
Description copied from interface: Decoder
The bin128 type consists of 16 consecutive octets of opaque binary data.

Returns:
the decoded byte array.

readBytes

public byte[] readBytes(int howManyBytes)
Description copied from interface: Decoder
Reads the given number of bytes.

Parameters:
howManyBytes - how many bytes need to be read?
Returns:
a byte array containing the requested data.

readDouble

public double readDouble()
Description copied from interface: Decoder
The double type encodes a double precision 64-bit floating point number. The format and operations are defined by the IEEE 754 standard for 64-bit double precision floating point numbers.

Returns:
the decoded double

readFloat

public float readFloat()
Description copied from interface: Decoder
The float type encodes a single precision 32-bit floating point number. The format and operations are defined by the IEEE 754 standard for 32-bit single precision floating point numbers.

Returns:
the decoded float.

readInt16

public short readInt16()
Description copied from interface: Decoder
The int16 type is a signed integral value encoded using a 16-bit two's complement representation in network byte order.

Returns:
the decoded integer.

readInt32

public int readInt32()
Description copied from interface: Decoder
The int32 type is a signed integral value encoded using a 32-bit two's complement representation in network byte order.

Returns:
the decoded integer.

readInt8

public byte readInt8()
Description copied from interface: Decoder
The int8 type is a signed integral value encoded using an 8-bit two's complement representation.

Returns:
the decoded integer.

readReaminingBytes

public byte[] readReaminingBytes()
Description copied from interface: Decoder
Reads the remaining bytes on the underlying buffer.

Returns:
the remaining bytes on the underlying buffer.

readInt64

public long readInt64()
Description copied from interface: Decoder
The int64 type is a signed integral value encoded using a 64-bit two's complement representation in network byte order.

Returns:
the decoded integer (as long).


Licensed to the Apache Software Foundation