From c40928cd674144fa5ed3dc7306c33b16823b2fad Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Jun 2018 11:53:11 +1200 Subject: Use slices instead of new buffers --- src/org/traccar/protocol/AlematicsFrameDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/org/traccar/protocol/AlematicsFrameDecoder.java') diff --git a/src/org/traccar/protocol/AlematicsFrameDecoder.java b/src/org/traccar/protocol/AlematicsFrameDecoder.java index daac868c0..be7666657 100644 --- a/src/org/traccar/protocol/AlematicsFrameDecoder.java +++ b/src/org/traccar/protocol/AlematicsFrameDecoder.java @@ -38,7 +38,7 @@ public class AlematicsFrameDecoder extends LineBasedFrameDecoder { } if (buf.getUnsignedShort(buf.readerIndex()) == 0xFAF8) { - ByteBuf heartbeat = buf.readBytes(12); + ByteBuf heartbeat = buf.readRetainedSlice(12); if (ctx != null && ctx.channel() != null) { ctx.channel().writeAndFlush(new NetworkMessage(heartbeat, ctx.channel().remoteAddress())); } -- cgit v1.2.3