UM Java API 6.17.1

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
com.latencybusters.pdm.PDMDeserializer Class Reference

## Public Member Functions
void | setByteSwap (byte[] ba, int pos, int magic)
boolean | isByteSwap ()
boolean | readBoolean (byte[] ba, int pos)
byte | readByte (byte[] ba, int pos)
short | readUByte (byte[] ba, int pos)
short | readShort (byte[] ba, int pos, boolean byteSwap)
short | readShort (byte[] ba, int pos)
int | readUShort (byte[] ba, int pos, boolean byteSwap)
int | readUShort (byte[] ba, int pos)
int | readInt (byte[] ba, int pos, boolean byteSwap)
int | readInt (byte[] ba, int pos)
long | readUInt (byte[] ba, int pos, boolean byteSwap)
long | readUInt (byte[] ba, int pos)
long | readLong (byte[] ba, int pos, boolean byteSwap)
long | readLong (byte[] ba, int pos)
BigInteger | readULong (byte[] ba, int pos, boolean byteSwap)
BigInteger | readULong (byte[] ba, int pos)
float | readFloat (byte[] ba, int pos, boolean byteSwap)
float | readFloat (byte[] ba, int pos)
double | readDouble (byte[] ba, int pos, boolean byteSwap)
double | readDouble (byte[] ba, int pos)
PDMDecimal | readDecimal (byte[] ba, int pos, boolean byteSwap)
PDMDecimal | readDecimal (byte[] ba, int pos)
PDMTimestamp | readTimestamp (byte[] ba, int pos, boolean byteSwap)
PDMTimestamp | readTimestamp (byte[] ba, int pos)
String | readString (byte[] ba, int pos, int len)
String | readUnicode (byte[] ba, int pos, int len, String charSet) throws UnsupportedEncodingException
String | readUnicode (byte[] ba, int pos, int len) throws UnsupportedEncodingException
void | readByteArray (byte[] ba, int pos, final byte[] destByteArray)
void | readByteArray (byte[] ba, int pos, final byte[] destByteArray, int copyLen)
byte[] | readByteArray (byte[] ba, int pos, int length)

## Detailed Description

Used to deserialize bytes into the appropriate type

Author
  jfugitt

## Member Function Documentation

boolean com.latencybusters.pdm.PDMDeserializer.isByteSwap | ( |  | ) |

Gets whether the byteSwap flag is set

Returns
  true if byteSwap flag is set

Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen().

boolean com.latencybusters.pdm.PDMDeserializer.readBoolean | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use one bytes from the given byte array starting at position to create a boolean.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the boolean

Referenced by com.latencybusters.pdm.PDMField.getBooleanArrayValue(), com.latencybusters.pdm.PDMField.getBooleanValue(), com.latencybusters.pdm.PDMFieldInfo.parse(), and com.latencybusters.pdm.PDMDefinition.parse().

byte com.latencybusters.pdm.PDMDeserializer.readByte | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use one bytes from the given byte array starting at position to create a byte.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the byte

Referenced by com.latencybusters.pdm.PDMField.getInt8ArrayValue(), com.latencybusters.pdm.PDMField.getInt8Value(), com.latencybusters.pdm.PDMDefinition.parse(), com.latencybusters.pdm.PDMDeserializer.readDecimal(), and com.latencybusters.pdm.PDMDeserializer.readUByte().

void com.latencybusters.pdm.PDMDeserializer.readByteArray | ( | byte[] | ba,
|  | int | pos,
|  | final byte[] | destByteArray
| ) |  |

Copies bytes from the source byte array (ba) into the destination byte array

Parameters

  ba | the byte array
  pos | the position to start reading
  destByteArray | the destination byte array

Referenced by com.latencybusters.pdm.PDMField.getBlobArrayValue(), com.latencybusters.pdm.PDMField.getBlobValue(), com.latencybusters.pdm.PDMField.getMessageArrayValue(), and com.latencybusters.pdm.PDMField.getMessageValue().

void com.latencybusters.pdm.PDMDeserializer.readByteArray | ( | byte[] | ba,
|  | int | pos,
|  | final byte[] | destByteArray,
|  | int | copyLen
| ) |  |

Copies bytes from the source byte array (ba) into the destination byte array

Parameters

  ba | the byte array
  pos | the position to start reading
  destByteArray | the destination byte array
  copyLen | the number of bytes to copy

byte [] com.latencybusters.pdm.PDMDeserializer.readByteArray | ( | byte[] | ba,
|  | int | pos,
|  | int | length
| ) |  |

Creates a new byte array from the source byte array (ba) at position for the given length

Parameters

  ba | the byte array
  pos | the position to start reading
  length | the length in bytes to copy

Returns
  the new byte array

PDMDecimal com.latencybusters.pdm.PDMDeserializer.readDecimal | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use nine bytes from the given byte array starting at position to create a PDMDecimal.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the PDMDecimal

References com.latencybusters.pdm.PDMDeserializer.readByte(), and com.latencybusters.pdm.PDMDeserializer.readLong().

Referenced by com.latencybusters.pdm.PDMField.getDecimalArrayValue(), com.latencybusters.pdm.PDMField.getDecimalValue(), and com.latencybusters.pdm.PDMDeserializer.readDecimal().

PDMDecimal com.latencybusters.pdm.PDMDeserializer.readDecimal | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a PDMDecimal.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the PDMDecimal

References com.latencybusters.pdm.PDMDeserializer.readDecimal().

double com.latencybusters.pdm.PDMDeserializer.readDouble | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a double.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the double

References com.latencybusters.pdm.PDMDeserializer.readLong().

Referenced by com.latencybusters.pdm.PDMField.getDoubleArrayValue(), and com.latencybusters.pdm.PDMField.getDoubleValue().

double com.latencybusters.pdm.PDMDeserializer.readDouble | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a double.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the double

References com.latencybusters.pdm.PDMDeserializer.readLong().

float com.latencybusters.pdm.PDMDeserializer.readFloat | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use four bytes from the given byte array starting at position to create a float.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the float

References com.latencybusters.pdm.PDMDeserializer.readInt().

Referenced by com.latencybusters.pdm.PDMField.getFloatArrayValue(), and com.latencybusters.pdm.PDMField.getFloatValue().

float com.latencybusters.pdm.PDMDeserializer.readFloat | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use four bytes from the given byte array starting at position to create a float.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the float

References com.latencybusters.pdm.PDMDeserializer.readInt().

int com.latencybusters.pdm.PDMDeserializer.readInt | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use four bytes from the given byte array starting at position to create an int.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the int

Referenced by com.latencybusters.pdm.PDMField.getBlobArrayValue(), com.latencybusters.pdm.PDMField.getInt32ArrayValue(), com.latencybusters.pdm.PDMField.getInt32Value(), com.latencybusters.pdm.PDMField.getMessageArrayValue(), com.latencybusters.pdm.PDMMessage.getMessageLen(), com.latencybusters.pdm.PDMField.getStringArrayValue(), com.latencybusters.pdm.PDMFieldInfo.parse(), com.latencybusters.pdm.PDMDefinition.parse(), com.latencybusters.pdm.PDMDeserializer.readFloat(), com.latencybusters.pdm.PDMDeserializer.readInt(), com.latencybusters.pdm.PDMDeserializer.readTimestamp(), com.latencybusters.pdm.PDMDeserializer.readUInt(), and com.latencybusters.pdm.PDMDeserializer.setByteSwap().

int com.latencybusters.pdm.PDMDeserializer.readInt | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use four bytes from the given byte array starting at position to create an int.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the int

References com.latencybusters.pdm.PDMDeserializer.readInt().

long com.latencybusters.pdm.PDMDeserializer.readLong | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a long.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the long

Referenced by com.latencybusters.pdm.PDMField.getInt64ArrayValue(), com.latencybusters.pdm.PDMField.getInt64Value(), com.latencybusters.pdm.PDMDeserializer.readDecimal(), com.latencybusters.pdm.PDMDeserializer.readDouble(), com.latencybusters.pdm.PDMDeserializer.readLong(), and com.latencybusters.pdm.PDMDeserializer.readULong().

long com.latencybusters.pdm.PDMDeserializer.readLong | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a long.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the long

References com.latencybusters.pdm.PDMDeserializer.readLong().

short com.latencybusters.pdm.PDMDeserializer.readShort | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use two bytes from the given byte array starting at position to create a short.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the short

Referenced by com.latencybusters.pdm.PDMField.getInt16ArrayValue(), com.latencybusters.pdm.PDMField.getInt16Value(), com.latencybusters.pdm.PDMFieldInfo.parse(), com.latencybusters.pdm.PDMDeserializer.readShort(), and com.latencybusters.pdm.PDMDeserializer.readUShort().

short com.latencybusters.pdm.PDMDeserializer.readShort | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use two bytes from the given byte array starting at position to create a short.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the short

References com.latencybusters.pdm.PDMDeserializer.readShort().

String com.latencybusters.pdm.PDMDeserializer.readString | ( | byte[] | ba,
|  | int | pos,
|  | int | len
| ) |  |

This method will read the specified len at position pos from the byte array and create a String expecting the String to end with a byte 0

Parameters

  ba | the byte array
  pos | the position to start reading
  len | the length of the string in bytes

Returns
  the String

Referenced by com.latencybusters.pdm.PDMField.getStringArrayValue(), com.latencybusters.pdm.PDMField.getStringValue(), and com.latencybusters.pdm.PDMFieldInfo.parse().

PDMTimestamp com.latencybusters.pdm.PDMDeserializer.readTimestamp | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a PDMTimestamp.

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the PDMTimestamp

References com.latencybusters.pdm.PDMDeserializer.readInt().

Referenced by com.latencybusters.pdm.PDMField.getTimestampArrayValue(), com.latencybusters.pdm.PDMField.getTimestampValue(), and com.latencybusters.pdm.PDMDeserializer.readTimestamp().

PDMTimestamp com.latencybusters.pdm.PDMDeserializer.readTimestamp | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use eight bytes from the given byte array starting at position to create a PDMTimestamp.

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the PDMTimestamp

References com.latencybusters.pdm.PDMDeserializer.readTimestamp().

short com.latencybusters.pdm.PDMDeserializer.readUByte | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use one bytes from the given byte array starting at position to create an unsigned byte (stored in a short).

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the unsigned byte

References com.latencybusters.pdm.PDMDeserializer.readByte().

Referenced by com.latencybusters.pdm.PDMField.getUInt8ArrayValue(), and com.latencybusters.pdm.PDMField.getUInt8Value().

long com.latencybusters.pdm.PDMDeserializer.readUInt | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use four bytes from the given byte array starting at position to create an unsigned int (stored as a long).

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the unsigned int

References com.latencybusters.pdm.PDMDeserializer.readInt().

Referenced by com.latencybusters.pdm.PDMField.getUInt32ArrayValue(), and com.latencybusters.pdm.PDMField.getUInt32Value().

long com.latencybusters.pdm.PDMDeserializer.readUInt | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use four bytes from the given byte array starting at position to create an unsigned int (stored as a long).

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the unsigned int

References com.latencybusters.pdm.PDMDeserializer.readInt().

BigInteger com.latencybusters.pdm.PDMDeserializer.readULong | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use eight bytes from the given byte array starting at position to create an unsigned long (stored in a BigInteger).

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the unsigned long

References com.latencybusters.pdm.PDMDeserializer.readLong().

Referenced by com.latencybusters.pdm.PDMField.getUInt64ArrayValue(), com.latencybusters.pdm.PDMField.getUInt64Value(), and com.latencybusters.pdm.PDMDeserializer.readULong().

BigInteger com.latencybusters.pdm.PDMDeserializer.readULong | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use eight bytes from the given byte array starting at position to create an unsigned long (stored in a BigInteger).

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the unsigned long

References com.latencybusters.pdm.PDMDeserializer.readULong().

String com.latencybusters.pdm.PDMDeserializer.readUnicode | ( | byte[] | ba,
|  | int | pos,
|  | int | len,
|  | String | charSet
| ) |  | throws UnsupportedEncodingException

This method will read the specified len at position pos from the byte array and create a unicode String expecting the String to end with a byte 0

Parameters

  ba | the byte array
  pos | the position to start reading
  len | the length of the string in bytes
  charSet | the character set

Returns
  the String

Exceptions

  UnsupportedEncodingException |

Referenced by com.latencybusters.pdm.PDMField.getStringArrayValue(), com.latencybusters.pdm.PDMField.getStringValue(), and com.latencybusters.pdm.PDMDeserializer.readUnicode().

String com.latencybusters.pdm.PDMDeserializer.readUnicode | ( | byte[] | ba,
|  | int | pos,
|  | int | len
| ) |  | throws UnsupportedEncodingException

This method will read the specified len at position pos from the byte array and create a UTF-8 unicode String expecting the String to end with a byte 0

Parameters

  ba | the byte array
  pos | the position to start reading
  len | the length of the string in bytes

Returns
  the String

Exceptions

  UnsupportedEncodingException |

References com.latencybusters.pdm.PDMDeserializer.readUnicode().

int com.latencybusters.pdm.PDMDeserializer.readUShort | ( | byte[] | ba,
|  | int | pos,
|  | boolean | byteSwap
| ) |  |

This method will use two bytes from the given byte array starting at position to create an unsigned short (stored as an int).

Parameters

  ba | the byte array
  pos | the position to start reading
  byteSwap | whether or not the bytes need to be swapped

Returns
  the unsigned short

References com.latencybusters.pdm.PDMDeserializer.readShort().

Referenced by com.latencybusters.pdm.PDMField.getUInt16ArrayValue(), com.latencybusters.pdm.PDMField.getUInt16Value(), and com.latencybusters.pdm.PDMDeserializer.readUShort().

int com.latencybusters.pdm.PDMDeserializer.readUShort | ( | byte[] | ba,
|  | int | pos
| ) |  |

This method will use two bytes from the given byte array starting at position to create an unsigned short (stored as an int).

Parameters

  ba | the byte array
  pos | the position to start reading

Returns
  the unsigned short

References com.latencybusters.pdm.PDMDeserializer.readUShort().

void com.latencybusters.pdm.PDMDeserializer.setByteSwap | ( | byte[] | ba,
|  | int | pos,
|  | int | magic
| ) |  |

Sets the flag on whether to swap bytes by comparing the magic number read in from the ba at the specified pos to the one passed in

Parameters

  ba | the byte array
  pos | the position to start reading
  magic |

References com.latencybusters.pdm.PDMDeserializer.readInt().

The documentation for this class was generated from the following file:

- PDMDeserializer.java