コード例 #1
0
  /**
   * Unpacks a Pdu from the underlying data.
   *
   * @throws java.nio.BufferUnderflowException if buff is too small
   * @see java.nio.ByteBuffer
   * @param buff The ByteBuffer at the position to begin reading
   * @since ??
   */
  public void unmarshal(java.nio.ByteBuffer buff) {
    super.unmarshal(buff);

    entityId.unmarshal(buff);
    communicationsDeviceID = (int) (buff.getShort() & 0xFFFF);
    encodingScheme = (int) (buff.getShort() & 0xFFFF);
    tdlType = (int) (buff.getShort() & 0xFFFF);
    sampleRate = buff.getInt();
    dataLength = (int) (buff.getShort() & 0xFFFF);
    samples = (int) (buff.getShort() & 0xFFFF);
    for (int idx = 0; idx < dataLength; idx++) {
      OneByteChunk anX = new OneByteChunk();
      anX.unmarshal(buff);
      data.add(anX);
    }
  } // end of unmarshal method
コード例 #2
0
  public void unmarshal(DataInputStream dis) {
    super.unmarshal(dis);

    try {
      entityId.unmarshal(dis);
      communicationsDeviceID = (int) dis.readUnsignedShort();
      encodingScheme = (int) dis.readUnsignedShort();
      tdlType = (int) dis.readUnsignedShort();
      sampleRate = dis.readInt();
      dataLength = (int) dis.readUnsignedShort();
      samples = (int) dis.readUnsignedShort();
      for (int idx = 0; idx < dataLength; idx++) {
        OneByteChunk anX = new OneByteChunk();
        anX.unmarshal(dis);
        data.add(anX);
      }

    } // end try
    catch (Exception e) {
      System.out.println(e);
    }
  } // end of unmarshal method