public class ByteUtil extends Object
| 构造器和说明 |
|---|
ByteUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
bytes2int(byte[] bytes,
int off)
把byte数组中off开始的4个字节,转为int类型,高位在前
|
static long |
bytes2long(byte[] bytes,
int off)
把byte数组中off开始的8个字节,转为long类型,高位在前
|
static short |
bytes2short(byte[] b,
int off)
把byte数组中off开始的2个字节,转为short类型,高位在前
|
static void |
int2bytes(int value,
byte[] bytes,
int off)
把int类型的value转为4个byte字节,放到byte数组的off开始的位置,高位在前
|
static void |
long2bytes(long value,
byte[] bytes,
int off)
把long类型的value转为8个byte字节,放到byte数组的off开始的位置,高位在前
|
static void |
short2bytes(short value,
byte[] bytes,
int off)
把short类型的value转为2个byte字节,放到byte数组的off开始的位置,高位在前
|
static byte[] |
toArray(List<Byte> list) |
static List<Byte> |
toList(byte[] array) |
public static void long2bytes(long value,
byte[] bytes,
int off)
value - bytes - off - public static long bytes2long(byte[] bytes,
int off)
bytes - off - public static void int2bytes(int value,
byte[] bytes,
int off)
value - bytes - off - public static int bytes2int(byte[] bytes,
int off)
bytes - off - public static void short2bytes(short value,
byte[] bytes,
int off)
value - bytes - off - public static short bytes2short(byte[] b,
int off)
b - off - Copyright © 2016. All rights reserved.