TDAT: private void parse(Connection con, ByteBuffer buf) { int sz = buf.getShort() & 0xFFFF; sz -= 2; ByteBuffer b = (ByteBuffer)buf.slice().limit(sz); b.order(ByteOrder.LITTLE_ENDIAN); buf.position(buf.position()+sz); // read message fully con.decript(b); con.addReceivedMsg(b); } COM: parse received packet push a message into inbound queue