|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.latencybusters.pdm.PDMDeserializer
public class PDMDeserializer
Used to deserialize bytes into the appropriate type
Constructor Summary | |
---|---|
PDMDeserializer()
|
Method Summary | |
---|---|
boolean |
isByteSwap()
Gets whether the byteSwap flag is set |
boolean |
readBoolean(byte[] ba,
int pos)
This method will use one bytes from the given byte array starting at position to create a boolean. |
byte |
readByte(byte[] ba,
int pos)
This method will use one bytes from the given byte array starting at position to create a byte. |
void |
readByteArray(byte[] ba,
int pos,
byte[] destByteArray)
Copies bytes from the source byte array (ba) into the destination byte array |
void |
readByteArray(byte[] ba,
int pos,
byte[] destByteArray,
int copyLen)
Copies bytes from the source byte array (ba) into the destination byte array |
byte[] |
readByteArray(byte[] ba,
int pos,
int length)
Creates a new byte array from the source byte array (ba) at position for the given length |
PDMDecimal |
readDecimal(byte[] ba,
int pos)
This method will use eight bytes from the given byte array starting at position to create a PDMDecimal . |
PDMDecimal |
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 . |
double |
readDouble(byte[] ba,
int pos)
This method will use eight bytes from the given byte array starting at position to create a double. |
double |
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. |
float |
readFloat(byte[] ba,
int pos)
This method will use four bytes from the given byte array starting at position to create a float. |
float |
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. |
int |
readInt(byte[] ba,
int pos)
This method will use four bytes from the given byte array starting at position to create an int. |
int |
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. |
long |
readLong(byte[] ba,
int pos)
This method will use eight bytes from the given byte array starting at position to create a long. |
long |
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. |
short |
readShort(byte[] ba,
int pos)
This method will use two bytes from the given byte array starting at position to create a short. |
short |
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. |
java.lang.String |
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 |
PDMTimestamp |
readTimestamp(byte[] ba,
int pos)
This method will use eight bytes from the given byte array starting at position to create a PDMTimestamp . |
PDMTimestamp |
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 . |
short |
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). |
long |
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). |
long |
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). |
java.math.BigInteger |
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). |
java.math.BigInteger |
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). |
java.lang.String |
readUnicode(byte[] ba,
int pos,
int len)
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 |
java.lang.String |
readUnicode(byte[] ba,
int pos,
int len,
java.lang.String charSet)
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 |
int |
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). |
int |
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). |
void |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDMDeserializer()
Method Detail |
---|
public void setByteSwap(byte[] ba, int pos, int magic)
ba
- the byte arraypos
- the position to start readingmagic
- public boolean isByteSwap()
public boolean readBoolean(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public byte readByte(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public short readUByte(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public short readShort(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public short readShort(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public int readUShort(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public int readUShort(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public int readInt(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public int readInt(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public long readUInt(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public long readUInt(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public long readLong(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public long readLong(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public java.math.BigInteger readULong(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public java.math.BigInteger readULong(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public float readFloat(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public float readFloat(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public double readDouble(byte[] ba, int pos, boolean byteSwap)
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
public double readDouble(byte[] ba, int pos)
ba
- the byte arraypos
- the position to start reading
public PDMDecimal readDecimal(byte[] ba, int pos, boolean byteSwap)
PDMDecimal
.
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
PDMDecimal
public PDMDecimal readDecimal(byte[] ba, int pos)
PDMDecimal
.
ba
- the byte arraypos
- the position to start reading
PDMDecimal
public PDMTimestamp readTimestamp(byte[] ba, int pos, boolean byteSwap)
PDMTimestamp
.
ba
- the byte arraypos
- the position to start readingbyteSwap
- whether or not the bytes need to be swapped
PDMTimestamp
public PDMTimestamp readTimestamp(byte[] ba, int pos)
PDMTimestamp
.
ba
- the byte arraypos
- the position to start reading
PDMTimestamp
public java.lang.String readString(byte[] ba, int pos, int len)
ba
- the byte arraypos
- the position to start readinglen
- the length of the string in bytes
public java.lang.String readUnicode(byte[] ba, int pos, int len, java.lang.String charSet) throws java.io.UnsupportedEncodingException
ba
- the byte arraypos
- the position to start readinglen
- the length of the string in bytescharSet
- the character set
java.io.UnsupportedEncodingException
public java.lang.String readUnicode(byte[] ba, int pos, int len) throws java.io.UnsupportedEncodingException
ba
- the byte arraypos
- the position to start readinglen
- the length of the string in bytes
java.io.UnsupportedEncodingException
public void readByteArray(byte[] ba, int pos, byte[] destByteArray)
ba
- the byte arraypos
- the position to start readingdestByteArray
- the destination byte arraypublic void readByteArray(byte[] ba, int pos, byte[] destByteArray, int copyLen)
ba
- the byte arraypos
- the position to start readingdestByteArray
- the destination byte arraycopyLen
- the number of bytes to copypublic byte[] readByteArray(byte[] ba, int pos, int length)
ba
- the byte arraypos
- the position to start readinglength
- the length in bytes to copy
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |