Package | Description |
---|---|
cn.hutool.core.io |
IO相关封装和工具类,包括Inputstream和OutputStream实现类,工具包括流工具IoUtil、文件工具FileUtil和Buffer工具BufferUtil
|
cn.hutool.http |
Hutool-http针对JDK的HttpUrlConnection做一层封装,简化了HTTPS请求、文件上传、Cookie记忆等操作,使Http请求变得无比简单。
|
Modifier and Type | Method and Description |
---|---|
static long |
IoUtil.copy(InputStream in,
OutputStream out,
int bufferSize,
StreamProgress streamProgress)
拷贝流,拷贝后不关闭流
|
static long |
NioUtil.copy(ReadableByteChannel in,
WritableByteChannel out,
int bufferSize,
StreamProgress streamProgress)
拷贝流,使用NIO,不会关闭channel
|
static long |
IoUtil.copy(Reader reader,
Writer writer,
int bufferSize,
StreamProgress streamProgress)
将Reader中的内容复制到Writer中,拷贝后不关闭Reader
|
static long |
NioUtil.copyByNIO(InputStream in,
OutputStream out,
int bufferSize,
StreamProgress streamProgress)
拷贝流 thanks to: https://github.com/venusdrogon/feilong-io/blob/master/src/main/java/com/feilong/io/IOWriteUtil.java
本方法不会关闭流 |
Modifier and Type | Method and Description |
---|---|
static long |
HttpUtil.download(String url,
OutputStream out,
boolean isCloseOut,
StreamProgress streamProgress)
下载远程文件
|
static long |
HttpUtil.downloadFile(String url,
File destFile,
int timeout,
StreamProgress streamProgress)
下载远程文件
|
static long |
HttpUtil.downloadFile(String url,
File destFile,
StreamProgress streamProgress)
下载远程文件
|
static File |
HttpUtil.downloadFileFromUrl(String url,
File destFile,
int timeout,
StreamProgress streamProgress)
下载远程文件
|
static File |
HttpUtil.downloadFileFromUrl(String url,
File destFile,
StreamProgress streamProgress)
下载远程文件
|
static String |
HttpUtil.downloadString(String url,
Charset customCharset,
StreamProgress streamPress)
下载远程文本
|
long |
HttpResponse.writeBody(File destFile,
StreamProgress streamProgress)
将响应内容写出到文件
异步模式下直接读取Http流写出,同步模式下将存储在内存中的响应内容写出 写出后会关闭Http流(异步模式) |
long |
HttpResponse.writeBody(OutputStream out,
boolean isCloseOut,
StreamProgress streamProgress)
|
Copyright © 2021. All rights reserved.