// update message length in message header // (first two bytes formatted in Little Endian) private void updateMsgLength() { byte[] b2 = Common.short2LEshort( (short) (count - 2)); // message size excludes th first 2 bytes in which message size is // provided System.arraycopy(b2, 0, buf, 0, 2); }
// update message number in message header // (byte 3 & 4 formatted in Little Endian) public void setMsgNumber(short n) { byte[] b2 = Common.short2LEshort(n); System.arraycopy(b2, 0, buf, 2, 2); }