public void setBody(ByteBuffer buffer) throws MSGException { try { msgId = Tools.bytesToLong(buffer.removeBytes(8).getBuffer()); result = buffer.removeByte(); } catch (NotEnoughDataInByteBufferException e) { throw new MSGException(e); } }
public ByteBuffer getBody() { ByteBuffer buffer = new ByteBuffer(); buffer.appendBytes(Tools.longToBytes(msgId)); buffer.appendByte((byte) result); return buffer; }