Beispiel #1
0
  /**
   * Decodes OEM IANA.
   *
   * @param rawMessage - Byte array holding whole message data.
   * @return OEM IANA number.
   */
  private int decodeOEMIANA(byte[] rawMessage) {
    byte[] oemIANA = new byte[4];

    System.arraycopy(rawMessage, 3, oemIANA, 0, 3);
    oemIANA[3] = 0;

    return TypeConverter.littleEndianByteArrayToInt(oemIANA);
  }
Beispiel #2
0
  @Override
  protected int decodePayloadLength(byte[] rawData, int offset) {
    byte[] payloadLength = new byte[4];
    System.arraycopy(rawData, offset, payloadLength, 0, 2);
    payloadLength[2] = 0;
    payloadLength[3] = 0;

    return TypeConverter.littleEndianByteArrayToInt(payloadLength);
  }