aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/RetranslatorFrameDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-12 13:57:19 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-12 13:57:19 +1200
commit1fe468bf5b004845e8904b66198597d28d37a029 (patch)
treebdd210609275a0acc3bfc13159eb92e28bdd4485 /src/org/traccar/protocol/RetranslatorFrameDecoder.java
parent69a4af1c2b419fd7cc6356bcc2bf760969a73f95 (diff)
downloadtrackermap-server-1fe468bf5b004845e8904b66198597d28d37a029.tar.gz
trackermap-server-1fe468bf5b004845e8904b66198597d28d37a029.tar.bz2
trackermap-server-1fe468bf5b004845e8904b66198597d28d37a029.zip
Migrate new protocols
Diffstat (limited to 'src/org/traccar/protocol/RetranslatorFrameDecoder.java')
-rw-r--r--src/org/traccar/protocol/RetranslatorFrameDecoder.java15
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 {