public class ByteUtils
extends java.lang.Object
| 构造器和说明 |
|---|
ByteUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
short |
bytes2Short(byte[] bytes) |
static int |
bytesToInt(byte[] bytes)
将长度为 4 的字节数组转成 int
|
static java.lang.String |
getIntByteString(int a)
获取 int 类型数据的二进制字符串
int 115 byte:00000000 00000000 00000000 01110011 int -115 byte:11111111 11111111 11111111 10001101 |
static java.lang.String |
getLongByteString(long a)
获取 long 类型数据的二进制字符串
long 115 byte:00000000 00000000 00000000 00000000 00000000 00000000 00000000 01110011 long -115 byte:11111111 11111111 11111111 11111111 11111111 11111111 11111111 10001101 |
static byte[] |
int2Bytes(int data)
将 int 转成长度为 4 的字节数组
|
byte[] |
short2Bytes(short data) |
public byte[] short2Bytes(short data)
public short bytes2Short(byte[] bytes)
public static byte[] int2Bytes(int data)
data - intpublic static int bytesToInt(byte[] bytes)
bytes - 长度为 4 的字节数组public static java.lang.String getIntByteString(int a)
a - int 类型public static java.lang.String getLongByteString(long a)
a - long 类型Copyright © 2020. All Rights Reserved.