UM .NET API  6.16.1
com.latencybusters.pdm.PDMSerializer Class Reference

Used to serialize a type into an array of bytes. More...

Public Member Functions

virtual int writeBoolean (byte[] ba, int pos, bool b)
 Writes the boolean as 1 byte into the byte array at position. More...
 
virtual int writeByte (byte[] byteArr, int pos, sbyte b)
 Writes the byte as 1 byte into the byte array at position. More...
 
virtual int writeUByte (byte[] ba, int pos, byte b)
 Writes the unsigned byte (short) as 1 byte into the byte array at position. More...
 
virtual int writeShort (byte[] ba, int pos, short s)
 
  • Writes the short as 2 bytes into the byte array at position
More...
 
virtual int writeUShort (byte[] ba, int pos, ushort s)
 Writes the unsigned short (int) as 2 bytes into the byte array at position. More...
 
virtual int writeInt (byte[] ba, int pos, int i)
 Writes the int as 4 bytes into the byte array at position. More...
 
virtual int writeUInt (byte[] ba, int pos, uint i)
 Writes the unsigned int (long) as 4 bytes into the byte array at position. More...
 
virtual int writeLong (byte[] ba, int pos, long l)
 Writes the long as 8 bytes into the byte array at position. More...
 
virtual int writeULong (byte[] ba, int pos, ulong l)
 Writes the ulong as 8 bytes into the byte array at position. More...
 
virtual int writeFloat (byte[] ba, int pos, float f)
 Writes the float as 4 bytes into the byte array at position. More...
 
virtual int writeDouble (byte[] ba, int pos, double d)
 Writes the double as 8 bytes into the byte array at position. More...
 
virtual int writeDecimal (byte[] ba, int pos, PDMDecimal dec)
 Writes the PDMDecimal as 9 bytes into the byte array at position. More...
 
virtual int writeTimestamp (byte[] ba, int pos, PDMTimestamp ts)
 Writes the PDMTimestamp as 8 bytes into the byte array at position. More...
 
virtual int writeString (byte[] ba, int pos, System.String s)
 Writes the non-null String into the byte array at position and appends a 0 byte after the String. More...
 
virtual int writeUnicode (byte[] ba, int pos, System.String s, System.String charSet)
 Writes the non-null unicode String into the byte array at position and appends a 0 byte after the String. More...
 
virtual int writeUnicode (byte[] ba, int pos, System.String s)
 Writes the non-null unicode String into the byte array as UTF-8 at position and appends a 0 byte after the String. More...
 
virtual int writeByteArray (byte[] ba, int pos, byte[] sourceByteArray)
 Copies the source byte array into the byte array at position. More...
 

Detailed Description

Used to serialize a type into an array of bytes.

Member Function Documentation

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

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(), and com.latencybusters.pdm.PDMDefinition.toBytes().

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

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

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

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

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

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.getFields(), and com.latencybusters.pdm.PDMField.setValue().

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

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.PDMDecimal.Exponent, and com.latencybusters.pdm.PDMDecimal.Mantissa.

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

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

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

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

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

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

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

virtual int com.latencybusters.pdm.PDMSerializer.writeInt ( byte[]  ba,
int  pos,
int  i 
)
virtual

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

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

Referenced by com.latencybusters.pdm.PDMField.isValueSet(), com.latencybusters.pdm.PDMField.setValue(), com.latencybusters.pdm.PDMOffsetTable.toBytes(), com.latencybusters.pdm.PDMMessageHeader.toBytes(), com.latencybusters.pdm.PDMSegmentHeader.toBytes(), and com.latencybusters.pdm.PDMDefinition.toBytes().

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

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.isValueSet(), and com.latencybusters.pdm.PDMField.setValue().

virtual int com.latencybusters.pdm.PDMSerializer.writeShort ( byte[]  ba,
int  pos,
short  s 
)
virtual

  • 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.isValueSet(), com.latencybusters.pdm.PDMField.setValue(), and com.latencybusters.pdm.PDMSegmentHeader.toBytes().

virtual int com.latencybusters.pdm.PDMSerializer.writeString ( byte[]  ba,
int  pos,
System.String  s 
)
virtual

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
sthe String to write
Returns
the updated position in the byte array after the write

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

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

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.PDMTimestamp.Microseconds, and com.latencybusters.pdm.PDMTimestamp.Seconds.

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

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

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

Parameters
bathe byte array
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().

virtual int com.latencybusters.pdm.PDMSerializer.writeUInt ( byte[]  ba,
int  pos,
uint  i 
)
virtual

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

Parameters
bathe byte array
posthe starting position
ithe uint to write
Returns
the updated position in the byte array after the write

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

virtual int com.latencybusters.pdm.PDMSerializer.writeULong ( byte[]  ba,
int  pos,
ulong  l 
)
virtual

Writes the ulong as 8 bytes into the byte array at position.

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

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

virtual int com.latencybusters.pdm.PDMSerializer.writeUnicode ( byte[]  ba,
int  pos,
System.String  s,
System.String  charSet 
)
virtual

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

UnsupportedEncodingException

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

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

virtual int com.latencybusters.pdm.PDMSerializer.writeUnicode ( byte[]  ba,
int  pos,
System.String  s 
)
virtual

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

UnsupportedEncodingException

Parameters
bathe byte array
posthe starting position
sthe Unicode String to write
Returns
the updated position in the byte array after the write
virtual int com.latencybusters.pdm.PDMSerializer.writeUShort ( byte[]  ba,
int  pos,
ushort  s 
)
virtual

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

Parameters
bathe byte array
posthe starting position
sthe ushort to write
Returns
the updated position in the byte array after the write

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


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