public class DownloadedFile extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
InputStream |
content
内容流
|
String |
contentType
内容类型(有些地方会动态构建,所以不能只读)
|
String |
name
文件名(带扩展名,例:demo.jpg)
|
| 构造器和说明 |
|---|
DownloadedFile() |
DownloadedFile(String contentType,
byte[] content,
String name) |
DownloadedFile(String contentType,
InputStream content,
String name)
基于下载输出的构建函数
|
public String contentType
public InputStream content
public String name
public DownloadedFile()
public DownloadedFile(String contentType, InputStream content, String name)
contentType - 内容类型content - 内容流name - 文件名public void transferTo(File file) throws IOException
file - 文件IOExceptionpublic void transferTo(OutputStream stream) throws IOException
stream - 输出流IOExceptionCopyright © 2022. All rights reserved.