diff options
Diffstat (limited to 'src/org/traccar/helper/ChannelBufferTools.java')
-rw-r--r-- | src/org/traccar/helper/ChannelBufferTools.java | 11 |
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; + } } |