aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/BitUtil.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-28 11:03:08 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-28 11:03:08 +1200
commit7927d2d8adb41605127af47060626f3f752a4f07 (patch)
treefe36b8264abbccbdf9c11d17eb5551e629c95597 /src/org/traccar/helper/BitUtil.java
parent8ee694af98493830380e5faf96d43752002ca634 (diff)
downloadtrackermap-server-7927d2d8adb41605127af47060626f3f752a4f07.tar.gz
trackermap-server-7927d2d8adb41605127af47060626f3f752a4f07.tar.bz2
trackermap-server-7927d2d8adb41605127af47060626f3f752a4f07.zip
Add MXT extra data decoding
Diffstat (limited to 'src/org/traccar/helper/BitUtil.java')
-rw-r--r--src/org/traccar/helper/BitUtil.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/helper/BitUtil.java b/src/org/traccar/helper/BitUtil.java
index 6e03e6d2a..193b12cda 100644
--- a/src/org/traccar/helper/BitUtil.java
+++ b/src/org/traccar/helper/BitUtil.java
@@ -24,10 +24,18 @@ public class BitUtil {
return (number & (1 << index)) != 0;
}
+ public static int range(int number, int index) {
+ return (number >> index);
+ }
+
public static int range(int number, int index, int length) {
return (number >> index) & ((1 << length) - 1);
}
+ public static long range(long number, int index) {
+ return (number >> index);
+ }
+
public static long range(long number, int index, int length) {
return (number >> index) & ((1l << length) - 1);
}