aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 14:32:15 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 14:32:15 +1300
commit622706ec1c8e2a78dae161a1db64b09247efbfd9 (patch)
treeaa22abb7a2c8d3569b302a4a88c6204c9dc67109 /src/org/traccar
parent09b4183fd7ba546209d422d53ea07e273bec26f3 (diff)
downloadtrackermap-server-622706ec1c8e2a78dae161a1db64b09247efbfd9.tar.gz
trackermap-server-622706ec1c8e2a78dae161a1db64b09247efbfd9.tar.bz2
trackermap-server-622706ec1c8e2a78dae161a1db64b09247efbfd9.zip
Remove readHexString util method
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/helper/ChannelBufferTools.java20
-rw-r--r--src/org/traccar/protocol/TzoneProtocolDecoder.java2
2 files changed, 1 insertions, 21 deletions
diff --git a/src/org/traccar/helper/ChannelBufferTools.java b/src/org/traccar/helper/ChannelBufferTools.java
index 6c61287c9..db628a76b 100644
--- a/src/org/traccar/helper/ChannelBufferTools.java
+++ b/src/org/traccar/helper/ChannelBufferTools.java
@@ -50,26 +50,6 @@ public final class ChannelBufferTools {
}
/**
- * Return hex string
- */
- public static String readHexString(ChannelBuffer buf, int length) {
-
- StringBuilder result = new StringBuilder();
- Formatter formatter = new Formatter(result);
-
- for (int i = 0; i < length / 2; i++) {
- formatter.format("%02x", buf.readByte());
- }
-
- if (length % 2 != 0) {
- int b = buf.getUnsignedByte(buf.readerIndex());
- formatter.format("%01x", b >>> 4);
- }
-
- return result.toString();
- }
-
- /**
* Read BCD coded coordinate (first byte has sign bit)
*/
public static double readCoordinate(ChannelBuffer buf) {
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java
index 6805708b9..8f33831df 100644
--- a/src/org/traccar/protocol/TzoneProtocolDecoder.java
+++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java
@@ -150,7 +150,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
length += 1;
}
- String num = ChannelBufferTools.readHexString(buf, length);
+ String num = ChannelBuffers.hexDump(buf.readBytes(length / 2));
if (odd) {
num = num.substring(1);