public class ConvertUtil extends Object
| 构造器和说明 |
|---|
ConvertUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static char[] |
bytesToChars(byte[] bytes)
bytes数组转char数组
bytes to chars
|
static String |
bytesToHexString(byte[] bytes)
将二进制转换为十六进制字符输出
|
static int |
bytesToInt(byte[] bytes)
字节数组和整型的转换
|
static String |
byteToBinary(byte src)
将byte转换为对应的二进制字符串
|
static long |
byteToLong(byte[] b)
字节数组和长整型的转换
|
static short |
byteToShort(byte[] b)
字节的转换与短整型
|
static byte[] |
encodeBytes(byte[] source,
char split) |
static String |
hexStringtoBinarg(String hexStr)
将十六进制字符串转为二进制字符串
|
static byte[] |
hexStringToByte(String hexString)
把16进制字符串转换成字节数组
|
static byte[] |
intToByte(int i)
整型与字节数组的转换
|
static byte[] |
intToByte(int[] arr)
整型数组转换为字节数组的转换
|
static byte[] |
longToByte(long number)
字节数组和长整型的转换
|
static byte[] |
shortToByte(short number)
短整型与字节的转换
|
public static byte[] shortToByte(short number)
public static short byteToShort(byte[] b)
public static byte[] intToByte(int i)
public static byte[] intToByte(int[] arr)
arr - 整型数组public static byte[] encodeBytes(byte[] source,
char split)
public static char[] bytesToChars(byte[] bytes)
bytes - bytes数组public static int bytesToInt(byte[] bytes)
public static byte[] longToByte(long number)
public static long byteToLong(byte[] b)
public static String byteToBinary(byte src)
src - 要转换成二进制字符串的byte值public static String hexStringtoBinarg(String hexStr)
hexStr - 十六进制字符串public static String bytesToHexString(byte[] bytes)
bytes - bytes数组public static byte[] hexStringToByte(String hexString)
hexString - 16进制字符串Copyright © 2016. All rights reserved.