org.apache.qpid.framing
Class EncodingUtils

java.lang.Object
  extended by org.apache.qpid.framing.EncodingUtils

public class EncodingUtils
extends Object


Field Summary
static int SIZEOF_UNSIGNED_INT
           
static int SIZEOF_UNSIGNED_SHORT
           
 
Constructor Summary
EncodingUtils()
           
 
Method Summary
static char[] convertToHexCharArray(byte[] from)
           
static String convertToHexString(byte[] from)
           
static String convertToHexString(org.apache.mina.common.ByteBuffer bb)
           
static int encodedBooleanLength()
           
static int encodedByteLength()
           
static int encodedCharLength()
           
static int encodedContentLength(Content table)
           
static int encodedDoubleLength()
           
static int encodedFieldTableLength(FieldTable table)
           
static int encodedFloatLength()
           
static int encodedIntegerLength()
           
static int encodedLongLength()
           
static int encodedLongStringLength(char[] s)
           
static int encodedLongStringLength(String s)
           
static int encodedLongstrLength(byte[] bytes)
           
static int encodedShortLength()
           
static int encodedShortStringLength(AMQShortString s)
           
static int encodedShortStringLength(int i)
           
static int encodedShortStringLength(long l)
           
static int encodedShortStringLength(short s)
           
static int encodedShortStringLength(String s)
           
(package private) static byte[] hexToByteArray(String id)
           
static AMQShortString readAMQShortString(org.apache.mina.common.ByteBuffer buffer)
           
static boolean readBoolean(org.apache.mina.common.ByteBuffer buffer)
           
static boolean[] readBooleans(org.apache.mina.common.ByteBuffer buffer)
           
static byte readByte(org.apache.mina.common.ByteBuffer buffer)
           
static byte[] readBytes(org.apache.mina.common.ByteBuffer buffer)
           
static char readChar(org.apache.mina.common.ByteBuffer buffer)
           
static Content readContent(org.apache.mina.common.ByteBuffer buffer)
           
static double readDouble(org.apache.mina.common.ByteBuffer buffer)
           
static FieldTable readFieldTable(org.apache.mina.common.ByteBuffer buffer)
           
static float readFloat(org.apache.mina.common.ByteBuffer buffer)
           
static int readInteger(org.apache.mina.common.ByteBuffer buffer)
           
static long readLong(org.apache.mina.common.ByteBuffer buffer)
           
static long readLongAsShortString(org.apache.mina.common.ByteBuffer buffer)
           
static byte[] readLongstr(org.apache.mina.common.ByteBuffer buffer)
           
static String readLongString(org.apache.mina.common.ByteBuffer buffer)
           
static short readShort(org.apache.mina.common.ByteBuffer buffer)
           
static String readShortString(org.apache.mina.common.ByteBuffer buffer)
           
static long readTimestamp(org.apache.mina.common.ByteBuffer buffer)
           
static long readUnsignedInteger(org.apache.mina.common.ByteBuffer buffer)
           
static int unsignedIntegerLength()
           
static void writeBoolean(org.apache.mina.common.ByteBuffer buffer, Boolean aBoolean)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean[] values)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1, boolean value2)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3, boolean value4)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3, boolean value4, boolean value5)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3, boolean value4, boolean value5, boolean value6)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3, boolean value4, boolean value5, boolean value6, boolean value7)
           
static void writeByte(org.apache.mina.common.ByteBuffer buffer, Byte aByte)
           
static void writeBytes(org.apache.mina.common.ByteBuffer buffer, byte[] data)
           
static void writeChar(org.apache.mina.common.ByteBuffer buffer, char character)
           
static void writeContentBytes(org.apache.mina.common.ByteBuffer buffer, Content content)
           
static void writeDouble(org.apache.mina.common.ByteBuffer buffer, Double aDouble)
           
static void writeFieldTableBytes(org.apache.mina.common.ByteBuffer buffer, FieldTable table)
           
static void writeFloat(org.apache.mina.common.ByteBuffer buffer, Float aFloat)
           
static void writeInteger(org.apache.mina.common.ByteBuffer buffer, Integer aInteger)
           
static void writeLong(org.apache.mina.common.ByteBuffer buffer, Long aLong)
           
static void writeLongstr(org.apache.mina.common.ByteBuffer buffer, byte[] data)
          This is used for writing longstrs.
static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer, byte[] bytes)
           
static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer, char[] s)
           
static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer, String s)
           
static void writeShort(org.apache.mina.common.ByteBuffer buffer, Short aShort)
           
static void writeShortStringBytes(org.apache.mina.common.ByteBuffer buffer, AMQShortString s)
           
static void writeShortStringBytes(org.apache.mina.common.ByteBuffer buffer, String s)
           
static void writeTimestamp(org.apache.mina.common.ByteBuffer buffer, long timestamp)
           
static void writeUnsignedByte(org.apache.mina.common.ByteBuffer buffer, short b)
           
static void writeUnsignedInteger(org.apache.mina.common.ByteBuffer buffer, long l)
           
static void writeUnsignedShort(org.apache.mina.common.ByteBuffer buffer, int s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZEOF_UNSIGNED_SHORT

public static final int SIZEOF_UNSIGNED_SHORT
See Also:
Constant Field Values

SIZEOF_UNSIGNED_INT

public static final int SIZEOF_UNSIGNED_INT
See Also:
Constant Field Values
Constructor Detail

EncodingUtils

public EncodingUtils()
Method Detail

encodedShortStringLength

public static int encodedShortStringLength(String s)

encodedShortStringLength

public static int encodedShortStringLength(short s)

encodedShortStringLength

public static int encodedShortStringLength(int i)

encodedShortStringLength

public static int encodedShortStringLength(long l)

encodedShortStringLength

public static int encodedShortStringLength(AMQShortString s)

encodedLongStringLength

public static int encodedLongStringLength(String s)

encodedLongStringLength

public static int encodedLongStringLength(char[] s)

encodedLongstrLength

public static int encodedLongstrLength(byte[] bytes)

encodedFieldTableLength

public static int encodedFieldTableLength(FieldTable table)

encodedContentLength

public static int encodedContentLength(Content table)

writeShortStringBytes

public static void writeShortStringBytes(org.apache.mina.common.ByteBuffer buffer,
                                         String s)

writeShortStringBytes

public static void writeShortStringBytes(org.apache.mina.common.ByteBuffer buffer,
                                         AMQShortString s)

writeLongStringBytes

public static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer,
                                        String s)

writeLongStringBytes

public static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer,
                                        char[] s)

writeLongStringBytes

public static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer,
                                        byte[] bytes)

writeUnsignedByte

public static void writeUnsignedByte(org.apache.mina.common.ByteBuffer buffer,
                                     short b)

writeUnsignedShort

public static void writeUnsignedShort(org.apache.mina.common.ByteBuffer buffer,
                                      int s)

unsignedIntegerLength

public static int unsignedIntegerLength()

writeUnsignedInteger

public static void writeUnsignedInteger(org.apache.mina.common.ByteBuffer buffer,
                                        long l)

writeFieldTableBytes

public static void writeFieldTableBytes(org.apache.mina.common.ByteBuffer buffer,
                                        FieldTable table)

writeContentBytes

public static void writeContentBytes(org.apache.mina.common.ByteBuffer buffer,
                                     Content content)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean[] values)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1,
                                 boolean value2)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1,
                                 boolean value2,
                                 boolean value3)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1,
                                 boolean value2,
                                 boolean value3,
                                 boolean value4)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1,
                                 boolean value2,
                                 boolean value3,
                                 boolean value4,
                                 boolean value5)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1,
                                 boolean value2,
                                 boolean value3,
                                 boolean value4,
                                 boolean value5,
                                 boolean value6)

writeBooleans

public static void writeBooleans(org.apache.mina.common.ByteBuffer buffer,
                                 boolean value0,
                                 boolean value1,
                                 boolean value2,
                                 boolean value3,
                                 boolean value4,
                                 boolean value5,
                                 boolean value6,
                                 boolean value7)

writeLongstr

public static void writeLongstr(org.apache.mina.common.ByteBuffer buffer,
                                byte[] data)
This is used for writing longstrs.

Parameters:
buffer -
data -

writeTimestamp

public static void writeTimestamp(org.apache.mina.common.ByteBuffer buffer,
                                  long timestamp)

readBooleans

public static boolean[] readBooleans(org.apache.mina.common.ByteBuffer buffer)

readFieldTable

public static FieldTable readFieldTable(org.apache.mina.common.ByteBuffer buffer)
                                 throws AMQFrameDecodingException
Throws:
AMQFrameDecodingException

readContent

public static Content readContent(org.apache.mina.common.ByteBuffer buffer)
                           throws AMQFrameDecodingException
Throws:
AMQFrameDecodingException

readAMQShortString

public static AMQShortString readAMQShortString(org.apache.mina.common.ByteBuffer buffer)

readShortString

public static String readShortString(org.apache.mina.common.ByteBuffer buffer)

readLongString

public static String readLongString(org.apache.mina.common.ByteBuffer buffer)

readLongstr

public static byte[] readLongstr(org.apache.mina.common.ByteBuffer buffer)

readTimestamp

public static long readTimestamp(org.apache.mina.common.ByteBuffer buffer)

hexToByteArray

static byte[] hexToByteArray(String id)

convertToHexCharArray

public static char[] convertToHexCharArray(byte[] from)

convertToHexString

public static String convertToHexString(byte[] from)

convertToHexString

public static String convertToHexString(org.apache.mina.common.ByteBuffer bb)

writeBoolean

public static void writeBoolean(org.apache.mina.common.ByteBuffer buffer,
                                Boolean aBoolean)

readBoolean

public static boolean readBoolean(org.apache.mina.common.ByteBuffer buffer)

encodedBooleanLength

public static int encodedBooleanLength()

writeByte

public static void writeByte(org.apache.mina.common.ByteBuffer buffer,
                             Byte aByte)

readByte

public static byte readByte(org.apache.mina.common.ByteBuffer buffer)

encodedByteLength

public static int encodedByteLength()

writeShort

public static void writeShort(org.apache.mina.common.ByteBuffer buffer,
                              Short aShort)

readShort

public static short readShort(org.apache.mina.common.ByteBuffer buffer)

encodedShortLength

public static int encodedShortLength()

writeInteger

public static void writeInteger(org.apache.mina.common.ByteBuffer buffer,
                                Integer aInteger)

readInteger

public static int readInteger(org.apache.mina.common.ByteBuffer buffer)

encodedIntegerLength

public static int encodedIntegerLength()

writeLong

public static void writeLong(org.apache.mina.common.ByteBuffer buffer,
                             Long aLong)

readLong

public static long readLong(org.apache.mina.common.ByteBuffer buffer)

encodedLongLength

public static int encodedLongLength()

writeFloat

public static void writeFloat(org.apache.mina.common.ByteBuffer buffer,
                              Float aFloat)

readFloat

public static float readFloat(org.apache.mina.common.ByteBuffer buffer)

encodedFloatLength

public static int encodedFloatLength()

writeDouble

public static void writeDouble(org.apache.mina.common.ByteBuffer buffer,
                               Double aDouble)

readDouble

public static double readDouble(org.apache.mina.common.ByteBuffer buffer)

encodedDoubleLength

public static int encodedDoubleLength()

readBytes

public static byte[] readBytes(org.apache.mina.common.ByteBuffer buffer)

writeBytes

public static void writeBytes(org.apache.mina.common.ByteBuffer buffer,
                              byte[] data)

encodedCharLength

public static int encodedCharLength()

readChar

public static char readChar(org.apache.mina.common.ByteBuffer buffer)

writeChar

public static void writeChar(org.apache.mina.common.ByteBuffer buffer,
                             char character)

readLongAsShortString

public static long readLongAsShortString(org.apache.mina.common.ByteBuffer buffer)

readUnsignedInteger

public static long readUnsignedInteger(org.apache.mina.common.ByteBuffer buffer)


Licensed to the Apache Software Foundation