public class ByteUtil
extends java.lang.Object
Constructor and Description |
---|
ByteUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
byte2HexStr(byte b) |
static java.lang.String |
byte2PrintHex(byte[] raw,
int offset,
int count)
Print content
|
static java.lang.String |
bytes2HexStr_2(byte[] bytes) |
static byte[] |
concatByteArrays(byte[]... list)
Combine a list of byte arrays into a single byte array
|
static byte[] |
concatByteArrays(java.util.List<byte[]> list)
Combine a list of byte arrays into a single byte array
|
static java.lang.String |
hexStr2AsciiStr(java.lang.String hexStr) |
static byte |
hexStr2Byte(java.lang.String hexStr) |
static byte[] |
hexStr2Bytes_2(java.lang.String str) |
static byte[] |
hexStr2Bytes(java.lang.String hexStr) |
static java.lang.String |
hexStr2Str(java.lang.String hexStr) |
static byte[] |
int2BytesBE(int src)
Convert int to byte array, big endian mode (highest bit first)
|
static byte[] |
int2BytesLE(int src)
Convert int to byte array, little endian mode (lower bit first)
|
static byte[] |
long2Bytes(long v) |
static byte[] |
short2BytesBE(short src)
Convert short to byte array, big endian mode (high order first)
|
static byte[] |
short2BytesLE(short src)
Convert short to byte array, little endian mode (lower bit first)
|
static int |
unsignedByte2Int(byte[] src,
int offset)
Convert unsigned byte to int
|
static int |
unsignedInt2IntBE(byte[] src,
int offset)
Convert byte array to int, big endian mode (high bit first)
|
static int |
unsignedInt2IntLE(byte[] src,
int offset)
Convert byte array to int, little endian mode (lower bit first)
|
static int |
unsignedShort2IntBE(byte[] src,
int offset)
Convert unsigned short to int, big endian mode (high order first)
|
static int |
unsignedShort2IntLE(byte[] src,
int offset)
Convert unsigned short to int, little endian mode (lower first)
|
public static java.lang.String byte2PrintHex(byte[] raw, int offset, int count)
public static java.lang.String bytes2HexStr_2(byte[] bytes)
public static java.lang.String byte2HexStr(byte b)
public static byte[] hexStr2Bytes(java.lang.String hexStr)
public static byte[] hexStr2Bytes_2(java.lang.String str)
public static byte hexStr2Byte(java.lang.String hexStr)
public static java.lang.String hexStr2Str(java.lang.String hexStr)
public static java.lang.String hexStr2AsciiStr(java.lang.String hexStr)
public static int unsignedShort2IntBE(byte[] src, int offset)
public static int unsignedShort2IntLE(byte[] src, int offset)
public static int unsignedByte2Int(byte[] src, int offset)
public static int unsignedInt2IntBE(byte[] src, int offset)
public static int unsignedInt2IntLE(byte[] src, int offset)
public static byte[] int2BytesBE(int src)
public static byte[] int2BytesLE(int src)
public static byte[] short2BytesBE(short src)
public static byte[] short2BytesLE(short src)
public static byte[] concatByteArrays(byte[]... list)
public static byte[] concatByteArrays(java.util.List<byte[]> list)
public static byte[] long2Bytes(long v)