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