diff options
Diffstat (limited to 'src/org/traccar/protocol/RetranslatorFrameDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/RetranslatorFrameDecoder.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/RetranslatorFrameDecoder.java b/src/org/traccar/protocol/RetranslatorFrameDecoder.java index 1836fb26e..1ad07b8da 100644 --- a/src/org/traccar/protocol/RetranslatorFrameDecoder.java +++ b/src/org/traccar/protocol/RetranslatorFrameDecoder.java @@ -15,19 +15,18 @@ */ package org.traccar.protocol; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.buffer.ChannelBuffers; -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 RetranslatorFrameDecoder extends FrameDecoder { +public class RetranslatorFrameDecoder extends BaseFrameDecoder { @Override protected Object decode( - ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { + ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { - int length = 4 + ChannelBuffers.swapInt(buf.getInt(buf.readerIndex())); + int length = 4 + buf.getIntLE(buf.readerIndex()); if (buf.readableBytes() >= length) { return buf.readBytes(length); } else { |