java.lang.Object
org.bitlap.roaringbitmap.longlong.IntegerUtil
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static bytefirstByte(int v) fetch the first bytestatic intfromBDBytes(byte[] bytes) convert into its integer representationstatic intsetByte(int v, byte bv, int pos) set a specified position byte to another value to return a fresh integerstatic intshiftLeftFromSpecifiedPosition(int v, int pos, int count) shift the byte left from the specified positionstatic byte[]toBDBytes(int v) convert integer to its byte array format
-
构造器详细资料
-
IntegerUtil
public IntegerUtil()
-
-
方法详细资料
-
toBDBytes
public static byte[] toBDBytes(int v) convert integer to its byte array format- 参数:
v- an input integer value- 返回:
- the big endian byte array representation
-
fromBDBytes
public static int fromBDBytes(byte[] bytes) convert into its integer representation- 参数:
bytes- the big endian integer's byte array- 返回:
- a integer corresponding to input bytes
-
setByte
public static int setByte(int v, byte bv, int pos) set a specified position byte to another value to return a fresh integer- 参数:
v- the input integer valuebv- the byte value to insertpos- the position of an 4 byte array to replace- 返回:
- a fresh integer after a specified position byte been replaced
-
shiftLeftFromSpecifiedPosition
public static int shiftLeftFromSpecifiedPosition(int v, int pos, int count) shift the byte left from the specified position- 参数:
v- a integer valuepos- the position from which to shift byte values leftcount- the shifting numbers- 返回:
- a fresh integer value
-
firstByte
public static byte firstByte(int v) fetch the first byte- 参数:
v- an input integer- 返回:
- the first byte of the big endian representation
-