Package com.luna.common.text
Class ByteUtils
java.lang.Object
com.luna.common.text.ByteUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
concat
(byte[] bytes1, byte[] bytes2) static byte[]
copy
(byte[] bs) 字节拷贝 以来native方法static byte[]
inputStream2ByteArray
(File file) static byte[]
inputStream2ByteArray
(String filePath) static byte[]
subBytes
(byte[] bs, int startIndex, int length) 字节截取static List<byte[]>
subToSmallBytes
(byte[] bs, int minLength, int maxLength) static List<byte[]>
subToSmallBytes
(File file, int subLen) static List<byte[]>
subToSmallBytes
(InputStream inputStream, int subLen)
-
Constructor Details
-
ByteUtils
public ByteUtils()
-
-
Method Details
-
subBytes
public static byte[] subBytes(byte[] bs, int startIndex, int length) 字节截取- Parameters:
bs
- 原始数据startIndex
- 开始length
- 长度- Returns:
-
copy
public static byte[] copy(byte[] bs) 字节拷贝 以来native方法- Parameters:
bs
- 原始数据- Returns:
-
concat
public static byte[] concat(byte[] bytes1, byte[] bytes2) -
subToSmallBytes
-
subToSmallBytes
- Throws:
FileNotFoundException
-
subToSmallBytes
-
inputStream2ByteArray
-
inputStream2ByteArray
-