Showing
1 changed file
with
1 additions
and
3 deletions
... | ... | @@ -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, | ... | ... |