public class LongUtils
extends java.lang.Object
| 构造器和说明 |
|---|
LongUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
compareHigh(byte[] a,
byte[] b)
compare according to the dictionary order
|
static long |
fromBDBytes(byte[] work)
get the long from the big endian representation bytes
|
static byte[] |
highPart(long num)
get the high 48 bit parts of the input data
|
static byte[] |
highPartInPlace(long num,
byte[] high48)
set the high 48 bit parts of the input number into the given byte array
|
static long |
initWithFirst4Byte(int v)
initialize a long value with the given fist 32 bit
|
static long |
leftShiftHighPart(long num)
shift the long by left the container size amount so we use the value after have done our steps
|
static char |
lowPart(long num)
get the low 16 bit parts of the input data
|
static int |
maxLowBitAsInteger() |
static long |
rightShiftHighPart(long num)
shift the long right by the container size amount so we can loop across containers by +1 steps
|
static byte[] |
toBDBytes(long v)
to big endian bytes representation
|
static long |
toLong(byte[] high,
char low)
reconstruct the long data
|
public static byte[] highPart(long num)
num - the long numberpublic static char lowPart(long num)
num - the long numberpublic static long toLong(byte[] high,
char low)
high - the high 48 bitlow - the low 16 bitpublic static byte[] toBDBytes(long v)
v - a long valuepublic static long fromBDBytes(byte[] work)
work - the byte arraypublic static int compareHigh(byte[] a,
byte[] b)
a - a byte arrayb - another byte arraypublic static long initWithFirst4Byte(int v)
v - first 32 bit valuepublic static long rightShiftHighPart(long num)
num - long being treated as unsigned longpublic static long leftShiftHighPart(long num)
num - uint48 to be shift back into uint64public static int maxLowBitAsInteger()
public static byte[] highPartInPlace(long num,
byte[] high48)
num - the long numberhigh48 - the byte array