diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-26 11:14:32 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-26 11:14:32 +1200 |
commit | f47ab14095137689e1c9040ab5add2f6e3174023 (patch) | |
tree | 90ccd5b960380f801b84c40c8e9e1145e89cab1f | |
parent | ce3b993656d351ac4d4f40271620587c69df0c6e (diff) | |
download | traccar-server-f47ab14095137689e1c9040ab5add2f6e3174023.tar.gz traccar-server-f47ab14095137689e1c9040ab5add2f6e3174023.tar.bz2 traccar-server-f47ab14095137689e1c9040ab5add2f6e3174023.zip |
Change buffer byte order
-rw-r--r-- | src/org/traccar/protocol/MxtFrameDecoder.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/MxtFrameDecoder.java b/src/org/traccar/protocol/MxtFrameDecoder.java index 82aa5c91a..56a90c765 100644 --- a/src/org/traccar/protocol/MxtFrameDecoder.java +++ b/src/org/traccar/protocol/MxtFrameDecoder.java @@ -21,6 +21,8 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.handler.codec.frame.FrameDecoder; +import java.nio.ByteOrder; + public class MxtFrameDecoder extends FrameDecoder { @Override @@ -35,7 +37,7 @@ public class MxtFrameDecoder extends FrameDecoder { int index = buf.indexOf(buf.readerIndex() + 1, buf.writerIndex(), (byte) 0x04); if (index != -1) { - ChannelBuffer result = ChannelBuffers.buffer(index + 1 - buf.readerIndex()); + ChannelBuffer result = ChannelBuffers.buffer(ByteOrder.LITTLE_ENDIAN, index + 1 - buf.readerIndex()); while (buf.readerIndex() <= index) { int b = buf.readUnsignedByte(); @@ -46,6 +48,8 @@ public class MxtFrameDecoder extends FrameDecoder { } } + String s = ChannelBuffers.hexDump(result); + return result; } |