UM Java API  6.16
com.latencybusters.pdm.PDMSerializer Class Reference

Public Member Functions

int writeBoolean (byte[] ba, int pos, final boolean b)
 
int writeByte (byte[] byteArr, int pos, final byte b)
 
int writeUByte (byte[] ba, int pos, final short b)
 
int writeShort (byte[] ba, int pos, final short s)
 
int writeUShort (byte[] ba, int pos, final int i)
 
int writeInt (byte[] ba, int pos, final int value)
 
int writeUInt (byte[] ba, int pos, final long value)
 
int writeLong (byte[] ba, int pos, final long l)
 
int writeULong (byte[] ba, int pos, final BigInteger bi)
 
int writeFloat (byte[] ba, int pos, final float f)
 
int writeDouble (byte[] ba, int pos, final double d)
 
int writeDecimal (byte[] ba, int pos, final PDMDecimal dec)
 
int writeTimestamp (byte[] ba, int pos, final PDMTimestamp ts)
 
int writeString (byte[] ba, int pos, final String value)
 
int writeUnicode (byte[] ba, int pos, final String value, String charSet) throws UnsupportedEncodingException
 
int writeUnicode (byte[] ba, int pos, final String value) throws UnsupportedEncodingException
 
int writeByteArray (byte[] ba, int pos, byte[] sourceByteArray)
 

Detailed Description

Used to serialize a type into an array of bytes

Author
jfugitt

Member Function Documentation

int com.latencybusters.pdm.PDMSerializer.writeBoolean ( byte[]  ba,
int  pos,
final boolean  b 
)

Writes the boolean as 1 byte into the byte array at position

Parameters
bathe byte array
posthe starting position
bthe bool to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue(), com.latencybusters.pdm.PDMFieldInfo.toBytes(), and com.latencybusters.pdm.PDMDefinition.toBytes().

int com.latencybusters.pdm.PDMSerializer.writeByte ( byte[]  byteArr,
int  pos,
final byte  b 
)

Writes the byte as 1 byte into the byte array at position

Parameters
byteArr
posthe starting position
bthe byte to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue(), com.latencybusters.pdm.PDMDefinition.toBytes(), com.latencybusters.pdm.PDMSerializer.writeDecimal(), com.latencybusters.pdm.PDMSerializer.writeString(), and com.latencybusters.pdm.PDMSerializer.writeUnicode().

int com.latencybusters.pdm.PDMSerializer.writeByteArray ( byte[]  ba,
int  pos,
byte[]  sourceByteArray 
)

Copies the source byte array into the byte array at position

Parameters
bathe byte array
posthe starting position
sourceByteArraythe source byte array
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMMessage.getMessageLen(), com.latencybusters.pdm.PDMField.setValue(), com.latencybusters.pdm.PDMSerializer.writeString(), and com.latencybusters.pdm.PDMSerializer.writeUnicode().

int com.latencybusters.pdm.PDMSerializer.writeDecimal ( byte[]  ba,
int  pos,
final PDMDecimal  dec 
)

Writes the PDMDecimal as 9 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
decthe PDMDecimal to write
Returns
the updated position in the byte array after the write

References com.latencybusters.pdm.PDMSerializer.writeByte(), and com.latencybusters.pdm.PDMSerializer.writeLong().

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeDouble ( byte[]  ba,
int  pos,
final double  d 
)

Writes the double as 8 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
dthe double to write
Returns
the updated position in the byte array after the write

References com.latencybusters.pdm.PDMSerializer.writeLong().

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeFloat ( byte[]  ba,
int  pos,
final float  f 
)

Writes the float as 4 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
fthe float to write
Returns
the updated position in the byte array after the write

References com.latencybusters.pdm.PDMSerializer.writeInt().

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeInt ( byte[]  ba,
int  pos,
final int  value 
)

Writes the int as 4 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
valuethe int to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue(), com.latencybusters.pdm.PDMFieldInfo.toBytes(), com.latencybusters.pdm.PDMDefinition.toBytes(), com.latencybusters.pdm.PDMSerializer.writeFloat(), and com.latencybusters.pdm.PDMSerializer.writeTimestamp().

int com.latencybusters.pdm.PDMSerializer.writeLong ( byte[]  ba,
int  pos,
final long  l 
)

Writes the long as 8 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
lthe long to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue(), com.latencybusters.pdm.PDMSerializer.writeDecimal(), and com.latencybusters.pdm.PDMSerializer.writeDouble().

int com.latencybusters.pdm.PDMSerializer.writeShort ( byte[]  ba,
int  pos,
final short  s 
)
  • Writes the short as 2 bytes into the byte array at position
    Parameters
    bathe byte array
    posthe starting position
    sthe short to write
    Returns
    the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue(), and com.latencybusters.pdm.PDMFieldInfo.toBytes().

int com.latencybusters.pdm.PDMSerializer.writeString ( byte[]  ba,
int  pos,
final String  value 
)

Writes the non-null String into the byte array at position and appends a 0 byte after the String

Parameters
bathe byte array
posthe starting position
valuethe String to write
Returns
the updated position in the byte array after the write

References com.latencybusters.pdm.PDMSerializer.writeByte(), and com.latencybusters.pdm.PDMSerializer.writeByteArray().

Referenced by com.latencybusters.pdm.PDMField.setValue(), and com.latencybusters.pdm.PDMFieldInfo.toBytes().

int com.latencybusters.pdm.PDMSerializer.writeTimestamp ( byte[]  ba,
int  pos,
final PDMTimestamp  ts 
)

Writes the PDMTimestamp as 8 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
tsthe PDMTimestamp to write
Returns
the updated position in the byte array after the write

References com.latencybusters.pdm.PDMSerializer.writeInt().

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeUByte ( byte[]  ba,
int  pos,
final short  b 
)

Writes the unsigned byte (short) as 1 byte into the byte array at position

Parameters
bathe byte array
posthe starting position
bthe ubyte (as a short) to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeUInt ( byte[]  ba,
int  pos,
final long  value 
)

Writes the unsigned int (long) as 4 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
valuethe uint (as a long) to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeULong ( byte []  ba,
int  pos,
final BigInteger  bi 
)

Writes the unsigned long (BigInteger) as 8 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
bithe ulong (as a BigInteger) to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue().

int com.latencybusters.pdm.PDMSerializer.writeUnicode ( byte[]  ba,
int  pos,
final String  value,
String  charSet 
) throws UnsupportedEncodingException

Writes the non-null unicode String into the byte array at position and appends a 0 byte after the String

Parameters
bathe byte array
posthe starting position
valuethe Unicode String to write
charSetthe character set
Returns
the updated position in the byte array after the write
Exceptions
UnsupportedEncodingException

References com.latencybusters.pdm.PDMSerializer.writeByte(), and com.latencybusters.pdm.PDMSerializer.writeByteArray().

Referenced by com.latencybusters.pdm.PDMField.setValue(), and com.latencybusters.pdm.PDMSerializer.writeUnicode().

int com.latencybusters.pdm.PDMSerializer.writeUnicode ( byte[]  ba,
int  pos,
final String  value 
) throws UnsupportedEncodingException

Writes the non-null unicode String into the byte array as UTF-8 at position and appends a 0 byte after the String

Parameters
bathe byte array
posthe starting position
valuethe Unicode String to write
Returns
the updated position in the byte array after the write
Exceptions
UnsupportedEncodingException

References com.latencybusters.pdm.PDMSerializer.writeUnicode().

int com.latencybusters.pdm.PDMSerializer.writeUShort ( byte[]  ba,
int  pos,
final int  i 
)

Writes the unsigned short (int) as 2 bytes into the byte array at position

Parameters
bathe byte array
posthe starting position
ithe ushort (as an int) to write
Returns
the updated position in the byte array after the write

Referenced by com.latencybusters.pdm.PDMField.setValue().


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