private void sendCRPPacket(int headType, CRPBody body) { byte[] bodyBytes = body.getBytes(); byte[] packet = new byte[CRPHead.LENGTH + bodyBytes.Length]; BytesUtil.Append(packet, CRPHead.getHeadBytes(headType)); BytesUtil.Append(packet, bodyBytes, CRPHead.LENGTH); tcpSocket.send(packet); }
private int checkDataType(byte[] head) { return(CRPHead.getType(head)); }