diff options
Diffstat (limited to 'src/org/traccar/protocol/AutoFonFrameDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AutoFonFrameDecoder.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/org/traccar/protocol/AutoFonFrameDecoder.java b/src/org/traccar/protocol/AutoFonFrameDecoder.java index 2fa1b4072..69f28133f 100644 --- a/src/org/traccar/protocol/AutoFonFrameDecoder.java +++ b/src/org/traccar/protocol/AutoFonFrameDecoder.java @@ -16,18 +16,16 @@ */ package org.traccar.protocol; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.handler.codec.frame.FrameDecoder; +import io.netty.buffer.ByteBuf; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; +import org.traccar.BaseFrameDecoder; -public class AutoFonFrameDecoder extends FrameDecoder { +public class AutoFonFrameDecoder extends BaseFrameDecoder { @Override protected Object decode( - ChannelHandlerContext ctx, - Channel channel, - ChannelBuffer buf) throws Exception { + ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { // Check minimum length if (buf.readableBytes() < 12) { @@ -58,7 +56,7 @@ public class AutoFonFrameDecoder extends FrameDecoder { // Check length and return buffer if (length != 0 && buf.readableBytes() >= length) { - return buf.readBytes(length); + return buf.readRetainedSlice(length); } return null; |