org.apache.qpid.transport.codec
Class BBEncoder

java.lang.Object
  extended by org.apache.qpid.transport.codec.AbstractEncoder
      extended by org.apache.qpid.transport.codec.BBEncoder
All Implemented Interfaces:
Encoder

public final class BBEncoder
extends AbstractEncoder

Byte Buffer Encoder. Encoder concrete implementor using a backing byte buffer for encoding data.


Constructor Summary
BBEncoder(int capacity)
           
 
Method Summary
 int beginSize16()
           
 int beginSize32()
           
 int beginSize8()
           
 ByteBuffer buffer()
           
protected  void doPut(byte b)
           
protected  void doPut(ByteBuffer src)
           
 void endSize16(int pos)
           
 void endSize32(int pos)
           
 void endSize8(int pos)
           
 void init()
           
protected  void put(byte[] bytes)
           
 ByteBuffer segment()
           
 void writeBin128(byte[] byteArray)
          The bin128 type consists of 16 consecutive octets of opaque binary data.
 void writeBin128(UUID id)
           
 void writeDouble(double aDouble)
          The double type encodes a double precision 64-bit floating point number.
 void writeFloat(float aFloat)
          The float type encodes a single precision 32-bit floating point number.
 void writeInt16(short aShort)
          The int16 type is a signed integral value encoded using a 16-bit two's complement representation in network byte order.
 void writeInt32(int anInt)
          The int32 type is a signed integral value encoded using a 32-bit two's complement representation in network byte order.
 void writeInt64(long aLong)
          The int64 type is a signed integral value encoded using a 64-bit two's complement representation in network byte order.
 void writeInt8(byte aByte)
          The int8 type is a signed integral value encoded using an 8-bit two's complement representation.
 void writeMagicNumber()
          Encodes the AMQP magic number.
 void writeUint16(int s)
          The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
 void writeUint32(long i)
          The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
 void writeUint64(long l)
          The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
 void writeUint8(short b)
          The uint8 type is an 8-bit unsigned integral value.
 
Methods inherited from class org.apache.qpid.transport.codec.AbstractEncoder
put, put, resolve, writeArray, writeArrayEntries, writeByteRanges, writeDatetime, writeList, writeListEntries, writeMap, writeMapEntries, writeSequenceNo, writeSequenceSet, writeStr16, writeStr8, writeStruct, writeStruct32, writeUuid, writeVbin16, writeVbin32, writeVbin8
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BBEncoder

public BBEncoder(int capacity)
Method Detail

init

public void init()

segment

public ByteBuffer segment()

buffer

public ByteBuffer buffer()

doPut

protected void doPut(byte b)
Specified by:
doPut in class AbstractEncoder

doPut

protected void doPut(ByteBuffer src)
Specified by:
doPut in class AbstractEncoder

put

protected void put(byte[] bytes)
Overrides:
put in class AbstractEncoder

writeUint8

public void writeUint8(short b)
Description copied from interface: Encoder
The uint8 type is an 8-bit unsigned integral value.

Specified by:
writeUint8 in interface Encoder
Overrides:
writeUint8 in class AbstractEncoder
Parameters:
b - the unsigned integer to be encoded.

writeUint16

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

Specified by:
writeUint16 in interface Encoder
Overrides:
writeUint16 in class AbstractEncoder
Parameters:
s - the unsigned integer to be encoded.

writeUint32

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

Specified by:
writeUint32 in interface Encoder
Overrides:
writeUint32 in class AbstractEncoder
Parameters:
i - the unsigned integer to be encoded.

writeUint64

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

Specified by:
writeUint64 in interface Encoder
Overrides:
writeUint64 in class AbstractEncoder

beginSize8

public int beginSize8()
Specified by:
beginSize8 in class AbstractEncoder

endSize8

public void endSize8(int pos)
Specified by:
endSize8 in class AbstractEncoder

beginSize16

public int beginSize16()
Specified by:
beginSize16 in class AbstractEncoder

endSize16

public void endSize16(int pos)
Specified by:
endSize16 in class AbstractEncoder

beginSize32

public int beginSize32()
Specified by:
beginSize32 in class AbstractEncoder

endSize32

public void endSize32(int pos)
Specified by:
endSize32 in class AbstractEncoder

writeDouble

public void writeDouble(double aDouble)
Description copied from interface: Encoder
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.

Parameters:
aDouble - the double to be encoded.

writeInt16

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

Parameters:
aShort - the integer to be encoded.

writeInt32

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

Parameters:
anInt - the integer to be encoded.

writeInt64

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

Parameters:
aLong - the integer to be encoded.

writeInt8

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

Parameters:
aByte - the integer to be encoded.

writeBin128

public void writeBin128(byte[] byteArray)
Description copied from interface: Encoder
The bin128 type consists of 16 consecutive octets of opaque binary data.

Parameters:
byteArray - the bytes array to be encoded.

writeBin128

public void writeBin128(UUID id)

writeFloat

public void writeFloat(float aFloat)
Description copied from interface: Encoder
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.

Parameters:
aFloat - the float to be encoded.

writeMagicNumber

public void writeMagicNumber()
Description copied from interface: Encoder
Encodes the AMQP magic number.



Licensed to the Apache Software Foundation