aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/helper/ChannelBufferTools.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/helper/ChannelBufferTools.java b/src/org/traccar/helper/ChannelBufferTools.java
index 09e3d5191..ef9384138 100644
--- a/src/org/traccar/helper/ChannelBufferTools.java
+++ b/src/org/traccar/helper/ChannelBufferTools.java
@@ -15,6 +15,7 @@
*/
package org.traccar.helper;
+import java.math.BigInteger;
import java.util.Formatter;
import org.jboss.netty.buffer.ChannelBuffer;
import org.traccar.protocol.IntellitracFrameDecoder;
@@ -144,4 +145,16 @@ public class ChannelBufferTools {
return out;
}
+ /**
+ * Convert byte array to hex string
+ */
+ public static String convertByteArray(byte[] in) {
+ StringBuilder out = new StringBuilder();
+ Formatter formatter = new Formatter(out);
+ for (byte b : in) {
+ formatter.format("%02x", b);
+ }
+ return out.toString();
+ }
+
}