public class HexUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
BytesToHex(byte[] buf)
把byte[]转换成十六进制字符串。
|
static String |
BytesToHex(byte[] buf,
CharSequence delimiter) |
static String |
BytesToHex(byte[] buf,
int start,
int size) |
static String |
BytesToHex(byte[] buf,
int start,
int size,
CharSequence delimiter) |
static String |
BytesToHex(IBytesRange bytesRange) |
static String |
BytesToHex(IBytesRange bytesRange,
CharSequence delimiter) |
static String |
BytesToMessage(byte[] buf)
输出包含字节数和HEX间空格的形式,适合人眼确认或在日志输出。
|
static String |
BytesToMessage(byte[] buf,
int start,
int size) |
static String |
ByteToHex(int byteVal) |
static String |
forceToByteSize(int byteCnt,
CharSequence hex) |
static byte[] |
HexToBytes(CharSequence hex)
把十六进制字符串HEX转换成byte[]
|
static boolean |
isHex(CharSequence hex) |
static boolean |
isStrictHex(CharSequence hex) |
static void |
main(String[] args) |
public static String BytesToHex(byte[] buf)
buf - 字节数组public static String BytesToHex(byte[] buf, int start, int size)
public static String BytesToHex(byte[] buf, CharSequence delimiter)
public static String BytesToHex(byte[] buf, int start, int size, CharSequence delimiter)
public static String BytesToHex(IBytesRange bytesRange)
public static String BytesToHex(IBytesRange bytesRange, CharSequence delimiter)
public static String BytesToMessage(byte[] buf)
buf - 字节数组public static String BytesToMessage(byte[] buf, int start, int size)
public static byte[] HexToBytes(CharSequence hex)
hex - HEX字符串public static boolean isStrictHex(CharSequence hex)
public static boolean isHex(CharSequence hex)
public static String ByteToHex(int byteVal)
public static String forceToByteSize(int byteCnt, CharSequence hex)
public static void main(String[] args)
Copyright © 2022. All rights reserved.