mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-06 00:24:08 +00:00
doc[protocol]: readRetainedSlice和byte[]数组相比,readRetainedSlice减少了垃圾回收
This commit is contained in:
@@ -62,6 +62,7 @@ public class TcpCodecHandler extends ByteToMessageCodec<EncodedPacketInfo> {
|
||||
|
||||
ByteBuf tmpByteBuf = null;
|
||||
try {
|
||||
// readRetainedSlice和byte[]数组相比,readRetainedSlice减少了垃圾回收
|
||||
tmpByteBuf = in.readRetainedSlice(length);
|
||||
DecodedPacketInfo packetInfo = NetContext.getPacketService().read(tmpByteBuf);
|
||||
out.add(packetInfo);
|
||||
|
||||
Reference in New Issue
Block a user