public class IntegerUtil
extends java.lang.Object
| 构造器和说明 |
|---|
IntegerUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte |
firstByte(int v)
fetch the first byte
|
static int |
fromBDBytes(byte[] bytes)
convert into its integer representation
|
static int |
setByte(int v,
byte bv,
int pos)
set a specified position byte to another value to return a fresh integer
|
static int |
shiftLeftFromSpecifiedPosition(int v,
int pos,
int count)
shift the byte left from the specified position
|
static byte[] |
toBDBytes(int v)
convert integer to its byte array format
|
public static byte[] toBDBytes(int v)
v - an input integer valuepublic static int fromBDBytes(byte[] bytes)
bytes - the big endian integer's byte arraypublic static int setByte(int v,
byte bv,
int pos)
v - the input integer valuebv - the byte value to insertpos - the position of an 4 byte array to replacepublic static int shiftLeftFromSpecifiedPosition(int v,
int pos,
int count)
v - a integer valuepos - the position from which to shift byte values leftcount - the shifting numberspublic static byte firstByte(int v)
v - an input integer