Commit 818e8fe4c5b990051ed0cc87eac79832d301382d

Authored by xp.Huang
1 parent a481b5eb

revert: TCP数据上报HEX解析还原

... ... @@ -17,8 +17,6 @@ import io.netty.channel.ChannelHandlerContext;
17 17 import io.netty.channel.ChannelInboundHandlerAdapter;
18 18 import io.netty.util.ReferenceCountUtil;
19 19 import java.net.InetSocketAddress;
20   -import java.nio.ByteBuffer;
21   -import java.nio.charset.StandardCharsets;
22 20 import java.util.*;
23 21
24 22 import io.netty.util.concurrent.Future;
... ... @@ -81,7 +79,7 @@ public class TcpTransportHandler extends ChannelInboundHandlerAdapter implements
81 79 if (msg instanceof ByteBuf) {
82 80 ByteBuf message = (ByteBuf) msg;
83 81 byte[] byteMsg = ByteBufUtils.buf2Bytes(message);
84   - String msgStr = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(byteMsg)).toString();
  82 + String msgStr = ByteUtils.bytesToStr(byteMsg);
85 83 log.debug(
86 84 "TCP服务【{}】收到设备【{}】来自【{}】数据【{}】",
87 85 sessionId,
... ...