public class ByteConvert
extends java.lang.Object
| 构造器和说明 |
|---|
ByteConvert() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.String |
byte2HexStr(byte[] datas)
bytes转换成十六进制字符串。
|
static int |
bytesToInt(byte[] datas)
4字节数据转整型值。
|
static int |
bytesToInt(byte[] datas,
int offset)
4字节byte 数组转 int。
|
static long |
bytesToLong(byte[] array)
8字节bytes 转 Long。
|
static long |
bytesToLong(byte[] array,
int offset)
8字节byte数组转长整型数字。
|
static short |
bytesToShort(byte[] datas)
2字节数据转短整型值。
|
static short |
bytesToShort(byte[] datas,
int offset)
2字节数据转短整型值。
|
static int |
bytesToUbyte(byte[] array)
1字节数据转无符号1字节整型值。
|
static int |
bytesToUbyte(byte[] array,
int offset)
1字节数据转无符号1字节整型值。
|
static long |
bytesToUint(byte[] array)
4字节数据转无符号整型值。
|
static long |
bytesToUint(byte[] array,
int offset)
4字节数据转无符号整型值。
|
static int |
bytesToUshort(byte[] datas)
2字节数据转无符号短整型值。
|
static int |
bytesToUshort(byte[] datas,
int offset)
2字节数据转无符号短整型值。
|
static short |
cBytesToShort(byte[] datas)
C语言2字节数据转短整型值。
|
static short |
cBytesToShort(byte[] datas,
int offset)
C语言2字节数据转短整型值。
|
static long |
cBytesToUint(byte[] array)
C语言的4字节数据转无符号整型值。
|
static long |
cBytesToUint(byte[] array,
int offset)
C语言4字节数据转无符号整型值。
|
static int |
cBytesToUshort(byte[] datas)
C语言2字节数据转无符号短整型值。
|
static int |
cBytesToUshort(byte[] datas,
int offset)
C语言2字节数据转无符号短整型值。
|
static byte[] |
intToBytes(int n)
整型值转为4字节数据。
|
static void |
intToBytes(int n,
byte[] array,
int offset)
整型值转为4字节数据。
|
static byte[] |
longToBytes(long val)
长整型转8字节byte数组。
|
static void |
longToBytes(long val,
byte[] array,
int offset)
长整型转8字节byte数组。
|
static byte[] |
shortToBytes(short val)
短整型转2字节数据。
|
static void |
shortToBytes(short val,
byte[] array,
int offset)
短整型转2字节数据。
|
static byte[] |
shortToCBytes(short val)
短整型转C语言2字节数据。
|
static byte[] |
ubyteToBytes(int n)
无符号1字节整型值转字节数据。
|
static void |
ubyteToBytes(int n,
byte[] array,
int offset)
无符号1字节整型值转字节数据。
|
static byte[] |
uintToBytes(long val)
无符号整型转4字节数组。
|
static void |
uintToBytes(long val,
byte[] array,
int offset)
无符号整型值转4字节数据。
|
static byte[] |
uintToCBytes(long val)
无符号整型转C语言4字节数组。
|
static byte[] |
ushortToBytes(int n)
无符号短整型值转2字节数据。
|
static void |
ushortToBytes(int n,
byte[] array,
int offset)
无符号短整型值转2字节数据。
|
static byte[] |
ushortToCBytes(int n)
无符号短整型值转2字节数据。
|
static void |
ushortToCBytes(int n,
byte[] array,
int offset)
无符号短整型值转C语言2字节数据。
|
public static byte[] longToBytes(long val)
val - 长整型数字public static void longToBytes(long val,
byte[] array,
int offset)
val - 长整型数字array - 转换后的结果offset - 从第offset位开始转换public static long bytesToLong(byte[] array)
array - 要转换的bytepublic static long bytesToLong(byte[] array,
int offset)
array - 要转换的byte数组offset - 从第offset开始转换public static byte[] intToBytes(int n)
n - public static void intToBytes(int n,
byte[] array,
int offset)
n - array - offset - public static int bytesToInt(byte[] datas)
datas - public static int bytesToInt(byte[] datas,
int offset)
datas - byte数组offset - 从数组的第几位开始转public static byte[] uintToBytes(long val)
val - 要转换的整型public static byte[] uintToCBytes(long val)
val - 要转换的整型public static void uintToBytes(long val,
byte[] array,
int offset)
val - array - offset - public static long bytesToUint(byte[] array)
array - public static long bytesToUint(byte[] array,
int offset)
array - offset - public static long cBytesToUint(byte[] array)
array - public static long cBytesToUint(byte[] array,
int offset)
array - offset - public static byte[] shortToBytes(short val)
val - public static byte[] shortToCBytes(short val)
val - public static void shortToBytes(short val,
byte[] array,
int offset)
val - array - offset - public static short bytesToShort(byte[] datas)
datas - public static short bytesToShort(byte[] datas,
int offset)
datas - offset - public static short cBytesToShort(byte[] datas)
datas - public static short cBytesToShort(byte[] datas,
int offset)
datas - offset - public static byte[] ushortToBytes(int n)
n - public static byte[] ushortToCBytes(int n)
n - public static void ushortToBytes(int n,
byte[] array,
int offset)
n - array - offset - public static void ushortToCBytes(int n,
byte[] array,
int offset)
n - array - offset - public static int bytesToUshort(byte[] datas)
datas - public static int bytesToUshort(byte[] datas,
int offset)
datas - offset - public static int cBytesToUshort(byte[] datas)
datas - public static int cBytesToUshort(byte[] datas,
int offset)
datas - offset - public static byte[] ubyteToBytes(int n)
n - public static void ubyteToBytes(int n,
byte[] array,
int offset)
n - array - offset - public static int bytesToUbyte(byte[] array)
array - public static int bytesToUbyte(byte[] array,
int offset)
array - offset - public static java.lang.String byte2HexStr(byte[] datas)
datas - Copyright © 2001-2014 hynnet.com