|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.npsnet.xrti.utilities.EncodingHelpers
Utility methods for encoding and decoding basic types, modeled after those supplied with the DMSO RTI.
| Constructor Summary | |
EncodingHelpers()
|
|
| Method Summary | |
static boolean |
decodeBoolean(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static byte |
decodeByte(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static double |
decodeDouble(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static float |
decodeFloat(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static char |
decodeChar(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static int |
decodeInt(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static long |
decodeLong(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static short |
decodeShort(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static java.lang.String |
decodeString(byte[] buffer)
Decodes and returns the value stored in the specified buffer. |
static byte[] |
encodeBoolean(boolean value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeByte(byte value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeDouble(double value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeFloat(float value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeChar(char value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeInt(int value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeLong(long value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeShort(short value)
Encodes the specified value, returning the result as a byte array. |
static byte[] |
encodeString(java.lang.String value)
Encodes the specified value, returning the result as a byte array. |
static void |
reverse(byte[] buffer)
Reverses the specified byte array in-place. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public EncodingHelpers()
| Method Detail |
public static byte[] encodeBoolean(boolean value)
value - the value to encode
public static byte[] encodeByte(byte value)
value - the value to encode
public static byte[] encodeChar(char value)
value - the value to encode
public static byte[] encodeDouble(double value)
value - the value to encode
public static byte[] encodeFloat(float value)
value - the value to encode
public static byte[] encodeInt(int value)
value - the value to encode
public static byte[] encodeLong(long value)
value - the value to encode
public static byte[] encodeShort(short value)
value - the value to encode
public static byte[] encodeString(java.lang.String value)
value - the value to encode
public static boolean decodeBoolean(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static byte decodeByte(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static char decodeChar(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static double decodeDouble(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static float decodeFloat(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static int decodeInt(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static long decodeLong(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static short decodeShort(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decoded
public static java.lang.String decodeString(byte[] buffer)
throws CouldNotDecode
buffer - the buffer containing the encoded value
CouldNotDecode - if the value could not be decodedpublic static void reverse(byte[] buffer)
buffer - the byte array to reverse
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||