public class UIoUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
默认缓存大小 8192
|
static int |
DEFAULT_LARGE_BUFFER_SIZE
默认大缓存大小 32768
|
static int |
DEFAULT_MIDDLE_BUFFER_SIZE
默认中等缓存大小 16384
|
static int |
EOF
数据流末尾
|
| Constructor and Description |
|---|
UIoUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable closeable)
关闭
关闭失败不会抛出异常 |
static long |
copy(InputStream in,
OutputStream out)
拷贝流,使用默认Buffer大小,拷贝后不关闭流
|
static long |
copy(InputStream in,
OutputStream out,
int bufferSize)
拷贝流,拷贝后不关闭流
|
static long |
copy(InputStream in,
OutputStream out,
int bufferSize,
StreamProgress streamProgress)
拷贝流,拷贝后不关闭流
|
static byte[] |
readBytes(InputStream in)
从流中读取bytes,读取完毕后关闭流
|
static byte[] |
readBytes(InputStream in,
boolean isCloseStream)
从流中读取bytes
|
static void |
write(OutputStream out,
boolean isCloseOut,
byte[] content)
将byte[]写到流中
|
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_MIDDLE_BUFFER_SIZE
public static final int DEFAULT_LARGE_BUFFER_SIZE
public static final int EOF
public static void close(Closeable closeable)
closeable - 被关闭的对象public static byte[] readBytes(InputStream in) throws IORuntimeException
in - InputStreamIORuntimeException - IO异常public static byte[] readBytes(InputStream in, boolean isCloseStream) throws IORuntimeException
in - InputStreamisCloseStream - 是否关闭输入流IORuntimeException - IO异常public static long copy(InputStream in, OutputStream out) throws IORuntimeException
in - 输入流out - 输出流IORuntimeException - IO异常public static long copy(InputStream in, OutputStream out, int bufferSize) throws IORuntimeException
in - 输入流out - 输出流bufferSize - 缓存大小IORuntimeException - IO异常public static long copy(InputStream in, OutputStream out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException
in - 输入流out - 输出流bufferSize - 缓存大小streamProgress - 进度条IORuntimeException - IO异常public static void write(OutputStream out, boolean isCloseOut, byte[] content) throws IORuntimeException
out - 输出流isCloseOut - 写入完毕是否关闭输出流content - 写入的内容IORuntimeException - IO异常Copyright © 2020. All rights reserved.