diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-26 13:11:19 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-26 13:11:19 +1300 |
commit | 3e56ea6a99e7da5d61c5956876c2d977268e4756 (patch) | |
tree | f70f61b1ec218e4491d36c10d5fbd52a67ba4862 /src/org/traccar/helper/ChannelBufferTools.java | |
parent | fbdd359d223579173b4e0076563df296f5492e3c (diff) | |
download | trackermap-server-3e56ea6a99e7da5d61c5956876c2d977268e4756.tar.gz trackermap-server-3e56ea6a99e7da5d61c5956876c2d977268e4756.tar.bz2 trackermap-server-3e56ea6a99e7da5d61c5956876c2d977268e4756.zip |
Use standard Java hex conversion
Diffstat (limited to 'src/org/traccar/helper/ChannelBufferTools.java')
-rw-r--r-- | src/org/traccar/helper/ChannelBufferTools.java | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/org/traccar/helper/ChannelBufferTools.java b/src/org/traccar/helper/ChannelBufferTools.java index 99da43b54..6c61287c9 100644 --- a/src/org/traccar/helper/ChannelBufferTools.java +++ b/src/org/traccar/helper/ChannelBufferTools.java @@ -17,6 +17,7 @@ package org.traccar.helper; import org.jboss.netty.buffer.ChannelBuffer; +import javax.xml.bind.DatatypeConverter; import java.util.Formatter; public final class ChannelBufferTools { @@ -89,22 +90,4 @@ public final class ChannelBufferTools { return value; } - public static byte[] hexToBytes(String in) { - int count = in.length() / 2; - byte[] out = new byte[count]; - for (int i = 0; i < count; i++) { - out[i] = (byte) Integer.parseInt(in.substring(i * 2, (i + 1) * 2), 16); - } - return out; - } - - public static String bytesToHex(byte[] in) { - StringBuilder out = new StringBuilder(); - Formatter formatter = new Formatter(out); - for (byte b : in) { - formatter.format("%02x", b); - } - return out.toString(); - } - } |