您需要使用
DataInputStream:
int start;do{ start = din.read();} while (start != -1 && start != 0x68);if (start == -1) throw new EOFException();int length = din.readUnsignedByte();byte[] message = new byte[length];din.readFully(message);return message;除非响应包含某种类型的请求ID,否则无法“响应特定请求查找最后一帧”的解决方案。



