| | |
| | | if (startIndex == -1) { |
| | | // 没有找到起始标记,清空无效数据 |
| | | if (debugEnabled) { |
| | | System.out.println("未找到起始标记,清空缓冲区"); |
| | | //System.out.println("未找到起始标记,清空缓冲区"); |
| | | } |
| | | staticBufferPosition = 0; |
| | | return; |
| | |
| | | System.arraycopy(staticDataBuffer, startIndex, packet, 0, totalPacketLength); |
| | | |
| | | if (debugEnabled) { |
| | | System.out.println("解析到完整数据包: " + bytesToHex(packet)); |
| | | //System.out.println("解析到完整数据包: " + bytesToHex(packet)); |
| | | } |
| | | |
| | | // 添加到返回列表 |
| | |
| | | */ |
| | | private static void printRawData(String prefix, byte[] data, int maxPrintLength) { |
| | | if (data == null || data.length == 0) { |
| | | System.out.println(prefix + ": 空数据"); |
| | | //System.out.println(prefix + ": 空数据"); |
| | | return; |
| | | } |
| | | |
| | |
| | | sb.append("... [截断,总长度: ").append(data.length).append("]"); |
| | | } |
| | | |
| | | System.out.println(sb.toString()); |
| | | //System.out.println(sb.toString()); |
| | | } |
| | | |
| | | /** |