public class ParserKit extends Object
| 构造器和说明 |
|---|
ParserKit() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
byteToString(byte[] bytes)
将byte[]转换成string
|
static byte[] |
copyByteBuf(io.netty.buffer.ByteBuf byteBuf)
将byteBuf转换成byte[]
|
static String |
decode(String bytes)
将十六进制数字解码成字符串,适用于所有字符(包括中文)
|
static String |
decodeToString(String str)
十六进制转字符串,适用于所有字符(包括中文)
|
static String |
encode(String str)
将字符串编码成十六进制数字,适用于所有字符(包括中文)
|
static String |
encodeToHex(int len,
String str)
字符串转十六进制,设置返回字符串长度(字节),前面位数不足的补0,适用于所有字符(包括中文)
|
static String |
getDecodeString(byte[] arr,
int offset,
int len)
字节数组转字符串,设置起始位,字节数
|
static String |
getReplaceStringHex(String stringHex,
char regex)
去除十六进制字符串里面的占位符号
|
static int |
hexToInt(String str)
十六进制转十进制
|
static String |
hexToString(String s)
十六进制转string
|
static String |
intToHex(int len,
int value)
十进制转十六进制,设置返回字符串长度(字节),前面补0
|
static void |
main(String[] args) |
static String |
stringToHex(int len,
String s)
string转十六进制,设置返回字符串长度(字节),前面补00
|
static String |
toZeroString(int len,
String s,
String x)
返回字符串,设置字符串长度(字节),前面补x
|
public static byte[] copyByteBuf(io.netty.buffer.ByteBuf byteBuf)
public static String byteToString(byte[] bytes)
public static String intToHex(int len, int value)
public static int hexToInt(String str)
public static String encodeToHex(int len, String str)
len - 字节数str - 待编码的字符串public static String getDecodeString(byte[] arr, int offset, int len)
public static String getReplaceStringHex(String stringHex, char regex)
public static void main(String[] args)
Copyright © 2019. All rights reserved.