aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-11 01:09:19 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-11 01:09:19 +1200
commit4c315abb231562bd90ccd97c8db945dde9ee80c9 (patch)
tree0351524f7b460f03c878026d1da6c63a1f461f13 /src
parent0d2428ff629728822adf5839a312a5ad3896e5e4 (diff)
downloadtrackermap-server-4c315abb231562bd90ccd97c8db945dde9ee80c9.tar.gz
trackermap-server-4c315abb231562bd90ccd97c8db945dde9ee80c9.tar.bz2
trackermap-server-4c315abb231562bd90ccd97c8db945dde9ee80c9.zip
Add array convertion method
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/helper/ChannelBufferTools.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/org/traccar/helper/ChannelBufferTools.java b/src/org/traccar/helper/ChannelBufferTools.java
index 4f1ebb7c0..c0df86bcd 100644
--- a/src/org/traccar/helper/ChannelBufferTools.java
+++ b/src/org/traccar/helper/ChannelBufferTools.java
@@ -97,4 +97,15 @@ public class ChannelBufferTools {
return result.toString();
}
+
+ /**
+ * Convert integer array to byte array
+ */
+ public static byte[] convertArray(int[] in) {
+ byte[] out = new byte[in.length];
+ for (int i = 0; i < in.length; i++) {
+ out[i] = (byte) in[i];
+ }
+ return out;
+ }
}