UM .NET API 6.17.1

- Main Page
- Related Pages
- Packages
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
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

  ba | the byte array
  pos | the starting position
  b | the 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

  byteArr | the byte array
  pos | the starting position
  b | the 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

  ba | the byte array
  pos | the starting position
  sourceByteArray | the 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

  ba | the byte array
  pos | the starting position
  dec | the 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

  ba | the byte array
  pos | the starting position
  d | the 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

  ba | the byte array
  pos | the starting position
  f | the 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

  ba | the byte array
  pos | the starting position
  i | the 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

  ba | the byte array
  pos | the starting position
  l | the 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

  ba | the byte array
  pos | the starting position
  s | the 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

  ba | the byte array
  pos | the starting position
  s | the 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

  ba | the byte array
  pos | the starting position
  ts | the 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

  ba | the byte array
  pos | the starting position
  b | the 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

  ba | the byte array
  pos | the starting position
  i | the 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

  ba | the byte array
  pos | the starting position
  l | the 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

  ba | the byte array
  pos | the starting position
  s | the Unicode String to write
  charSet | the 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

  ba | the byte array
  pos | the starting position
  s | the 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

  ba | the byte array
  pos | the starting position
  s | the 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:

- PDMSerializer.cs