diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-14 12:08:32 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-14 12:08:32 +1200 |
commit | 5c6a4302bb8ea3280d2f6633bd1017f9c6d21abd (patch) | |
tree | ed55d93b734b4becbad9a837b80c6728b3156753 /src/org/traccar/protocol/EnforaProtocolEncoder.java | |
parent | 051aeacefdf71959fcef25b33e1c139c845fddf5 (diff) | |
download | trackermap-server-5c6a4302bb8ea3280d2f6633bd1017f9c6d21abd.tar.gz trackermap-server-5c6a4302bb8ea3280d2f6633bd1017f9c6d21abd.tar.bz2 trackermap-server-5c6a4302bb8ea3280d2f6633bd1017f9c6d21abd.zip |
Fix FindBugs issues
Diffstat (limited to 'src/org/traccar/protocol/EnforaProtocolEncoder.java')
-rw-r--r-- | src/org/traccar/protocol/EnforaProtocolEncoder.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/EnforaProtocolEncoder.java b/src/org/traccar/protocol/EnforaProtocolEncoder.java index e7da87388..3dca1b9b3 100644 --- a/src/org/traccar/protocol/EnforaProtocolEncoder.java +++ b/src/org/traccar/protocol/EnforaProtocolEncoder.java @@ -30,13 +30,11 @@ public class EnforaProtocolEncoder extends StringProtocolEncoder { ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); - byte[] contentBytes = content.getBytes(); - - buf.writeShort(contentBytes.length + 6); + buf.writeShort(content.length() + 6); buf.writeShort(0); // index buf.writeByte(0x04); // command type buf.writeByte(0); // optional header - buf.writeBytes(content.getBytes(StandardCharsets.UTF_8)); + buf.writeBytes(content.getBytes(StandardCharsets.US_ASCII)); return buf; } |