public class IOUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
默认缓存大小 8192
|
| 构造器和说明 |
|---|
IOUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
copy(InputStream in,
OutputStream out,
int bufferSize,
long count)
拷贝流,拷贝后不关闭流
|
static byte[] |
readBytes(InputStream in,
int length)
读取指定长度的byte数组,不关闭流
|
static String |
readHex(InputStream in,
int length,
boolean toLowerCase)
读取16进制字符串
|
static String |
readHex64Upper(InputStream in)
从流中读取前64个byte并转换为16进制,字母部分使用大写
|
static String |
readHex8192Upper(InputStream in)
从流中读取前8192个byte并转换为16进制,字母部分使用大写
|
public static final int DEFAULT_BUFFER_SIZE
public static String readHex64Upper(InputStream in) throws RuntimeException
in - InputStreamRuntimeExceptionpublic static String readHex8192Upper(InputStream in) throws RuntimeException
in - InputStreamRuntimeExceptionpublic static String readHex(InputStream in, int length, boolean toLowerCase) throws RuntimeException
in - InputStreamlength - 长度toLowerCase - true 传换成小写格式 , false 传换成大写格式RuntimeExceptionpublic static byte[] readBytes(InputStream in, int length) throws RuntimeException
in - InputStream,为null返回nulllength - 长度,小于等于0返回空byte数组RuntimeExceptionpublic static long copy(InputStream in, OutputStream out, int bufferSize, long count) throws RuntimeException
in - 输入流out - 输出流bufferSize - 缓存大小count - 总拷贝长度RuntimeException - IO异常Copyright © 2024. All rights reserved.