Пример #1
0
  /**
   * Packs a Pdu into the ByteBuffer.
   *
   * @throws java.nio.BufferOverflowException if buff is too small
   * @throws java.nio.ReadOnlyBufferException if buff is read only
   * @see java.nio.ByteBuffer
   * @param buff The ByteBuffer at the position to begin writing
   * @since ??
   */
  public void marshal(java.nio.ByteBuffer buff) {
    super.marshal(buff);
    entityId.marshal(buff);
    buff.putShort((short) communicationsDeviceID);
    buff.putShort((short) encodingScheme);
    buff.putShort((short) tdlType);
    buff.putInt((int) sampleRate);
    buff.putShort((short) data.size());
    buff.putShort((short) samples);

    for (int idx = 0; idx < data.size(); idx++) {
      OneByteChunk aOneByteChunk = (OneByteChunk) data.get(idx);
      aOneByteChunk.marshal(buff);
    } // end of list marshalling
  } // end of marshal method
Пример #2
0
  public void marshal(DataOutputStream dos) {
    super.marshal(dos);
    try {
      entityId.marshal(dos);
      dos.writeShort((short) communicationsDeviceID);
      dos.writeShort((short) encodingScheme);
      dos.writeShort((short) tdlType);
      dos.writeInt((int) sampleRate);
      dos.writeShort((short) data.size());
      dos.writeShort((short) samples);

      for (int idx = 0; idx < data.size(); idx++) {
        OneByteChunk aOneByteChunk = data.get(idx);
        aOneByteChunk.marshal(dos);
      } // end of list marshalling

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