public class DownloadFileStream extends Object implements DownloadCallback<BufferedInputStream>
refactor: 将HttpServletResponse调整为OutputStream对象, 注意:使用时候在外层做response.getOutputStream(),使用完毕后,在外层做 os.close() 如: os = response.getOutputStream(); DownloadFileStream stream = new DownloadFileStream(os); ... os.close();
| 构造器和说明 |
|---|
DownloadFileStream(OutputStream responseOutputStream)
从HttpServletResponse对象response.getOutputStream()构造
|
DownloadFileStream(OutputStream responseOutputStream,
int bufferLength)
从HttpServletResponse对象response.getOutputStream()构造
|
public DownloadFileStream(OutputStream responseOutputStream)
responseOutputStream - 输出流public DownloadFileStream(OutputStream responseOutputStream, int bufferLength)
responseOutputStream - 输出流bufferLength - 缓存长度public BufferedInputStream recv(InputStream ins) throws IOException
recv 在接口中 DownloadCallback<BufferedInputStream>IOExceptionCopyright © 2020. All rights reserved.