diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-11 12:34:38 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-11 12:34:38 +1300 |
commit | b70eddfcda8262ec4bf76213d414ef55950478d0 (patch) | |
tree | c302957f3999fcf571c93a62778defcd403b5851 /src/org/traccar/protocol/AisProtocolDecoder.java | |
parent | c8fa36318702acc9ff54d3811e1f32c1035e85f3 (diff) | |
download | trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.tar.gz trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.tar.bz2 trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.zip |
Fix some code issues
Diffstat (limited to 'src/org/traccar/protocol/AisProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AisProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/AisProtocolDecoder.java b/src/org/traccar/protocol/AisProtocolDecoder.java index 3ccca6dd3..f04c558c2 100644 --- a/src/org/traccar/protocol/AisProtocolDecoder.java +++ b/src/org/traccar/protocol/AisProtocolDecoder.java @@ -24,6 +24,7 @@ import org.traccar.helper.PatternBuilder; import org.traccar.model.Position; import java.net.SocketAddress; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -110,7 +111,7 @@ public class AisProtocolDecoder extends BaseProtocolDecoder { if (count == 1) { BitBuffer bits = new BitBuffer(); - bits.writeEncoded(parser.next().getBytes()); + bits.writeEncoded(parser.next().getBytes(StandardCharsets.US_ASCII)); position = decodePayload(channel, remoteAddress, bits); } else { BitBuffer bits = buffers.get(id); @@ -118,7 +119,7 @@ public class AisProtocolDecoder extends BaseProtocolDecoder { bits = new BitBuffer(); buffers.put(id, bits); } - bits.writeEncoded(parser.next().getBytes()); + bits.writeEncoded(parser.next().getBytes(StandardCharsets.US_ASCII)); if (count == index) { position = decodePayload(channel, remoteAddress, bits); buffers.remove(id); |