org.apache.qpid.framing
Class EncodingUtils

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

public class EncodingUtils
extends java.lang.Object


Field Summary
static int SIZEOF_UNSIGNED_INT
           
static int SIZEOF_UNSIGNED_SHORT
           
 
Constructor Summary
EncodingUtils()
           
 
Method Summary
static char[] convertToHexCharArray(byte[] from)
           
static java.lang.String convertToHexString(byte[] from)
           
static java.lang.String convertToHexString(org.apache.mina.common.ByteBuffer bb)
           
static FieldTable createFieldTableFromMessageSelector(java.lang.String selector)
           
static int encodedFieldTableLength(FieldTable table)
           
static int encodedLongStringLength(char[] s)
           
static int encodedLongStringLength(java.lang.String s)
           
static int encodedLongstrLength(byte[] bytes)
           
static int encodedShortStringLength(java.lang.String s)
           
static void main(java.lang.String[] args)
           
static boolean[] readBooleans(org.apache.mina.common.ByteBuffer buffer)
           
static FieldTable readFieldTable(org.apache.mina.common.ByteBuffer buffer)
           
static byte[] readLongstr(org.apache.mina.common.ByteBuffer buffer)
           
static java.lang.String readLongString(org.apache.mina.common.ByteBuffer buffer)
           
static java.lang.String readShortString(org.apache.mina.common.ByteBuffer buffer)
           
static long readTimestamp(org.apache.mina.common.ByteBuffer buffer)
           
static void writeBooleans(org.apache.mina.common.ByteBuffer buffer, boolean[] values)
           
static void writeFieldTableBytes(org.apache.mina.common.ByteBuffer buffer, FieldTable table)
           
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, java.lang.String s)
           
static void writeShortStringBytes(org.apache.mina.common.ByteBuffer buffer, java.lang.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(java.lang.String s)

encodedLongStringLength

public static int encodedLongStringLength(java.lang.String s)

encodedLongStringLength

public static int encodedLongStringLength(char[] s)

encodedLongstrLength

public static int encodedLongstrLength(byte[] bytes)

encodedFieldTableLength

public static int encodedFieldTableLength(FieldTable table)

writeShortStringBytes

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

writeLongStringBytes

public static void writeLongStringBytes(org.apache.mina.common.ByteBuffer buffer,
                                        java.lang.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)

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)

writeBooleans

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

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

readShortString

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

readLongString

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

readLongstr

public static byte[] readLongstr(org.apache.mina.common.ByteBuffer buffer)
                          throws AMQFrameDecodingException
Throws:
AMQFrameDecodingException

readTimestamp

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

createFieldTableFromMessageSelector

public static FieldTable createFieldTableFromMessageSelector(java.lang.String selector)

convertToHexCharArray

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

convertToHexString

public static java.lang.String convertToHexString(byte[] from)

convertToHexString

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

main

public static void main(java.lang.String[] args)