public class Num
extends java.lang.Object
| 构造器和说明 |
|---|
Num() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.String |
byte2Hex(byte[] buf) |
static int |
byte2int(byte[] b,
int offset)
byte to int
|
static int |
bytes2int(byte[] bytes)
将bytes数组转回Integer类型
|
static long |
bytes2long(byte[] bytes)
将bytes数据转回Long类型
|
static java.lang.String |
byteToHex(byte b)
convert signed one byte into a hexadecimal digit
|
static long |
decryptLong(java.lang.String el) |
static java.lang.String |
encryptLong(long l) |
static long |
getLong(byte[] bb,
int index) |
static short |
getShort(byte[] b,
int index) |
static void |
int2byte(int n,
byte[] buf,
int offset)
int to byte
|
static byte[] |
int2bytes(int i)
将Integer类型转为bytes数组
|
static byte[] |
long2bytes(long l)
将long类型转为bytes数组
|
static void |
main(java.lang.String[] args) |
static void |
putLong(byte[] bb,
long x,
int index) |
static void |
putShort(byte[] b,
short s,
int index) |
static void |
short2byte(int n,
byte[] buf,
int offset) |
static byte[] |
str2Bcd(java.lang.String asc) |
static long |
unsigned4BytesToInt(byte[] buf,
int pos)
convert signed 4 bytes into a 32-bit integer
|
static int |
unsignedByteToInt(byte b) |
public static int byte2int(byte[] b,
int offset)
b - 待转换的字节数组offset - 偏移量,字节数组中开始转换的位置public static void int2byte(int n,
byte[] buf,
int offset)
n - 待转换的整形变量buf - 转换后生成的字节数组offset - 偏移量,字节数组中开始存放的位置public static void short2byte(int n,
byte[] buf,
int offset)
n - 待转换的short变量buf - 转换后存放的byte数组offset - 偏移量,字节数组中开始存放的位置public static java.lang.String byte2Hex(byte[] buf)
buf - 数组public static int unsignedByteToInt(byte b)
public static java.lang.String byteToHex(byte b)
b - bytepublic static long unsigned4BytesToInt(byte[] buf,
int pos)
buf - bytes bufferpos - beginning byte for convertingpublic static long getLong(byte[] bb,
int index)
public static void putLong(byte[] bb,
long x,
int index)
public static void putShort(byte[] b,
short s,
int index)
public static short getShort(byte[] b,
int index)
public static byte[] str2Bcd(java.lang.String asc)
public static byte[] int2bytes(int i)
i - intpublic static int bytes2int(byte[] bytes)
bytes - 字节数组public static byte[] long2bytes(long l)
l - longpublic static long bytes2long(byte[] bytes)
bytes - byte[]public static java.lang.String encryptLong(long l)
public static long decryptLong(java.lang.String el)
public static void main(java.lang.String[] args)