提交 ac8284ee authored 作者: 许俊's avatar 许俊

修改

上级 4961c1e1
......@@ -22,7 +22,7 @@ public class FileUtil {
try {
path = new File(ResourceUtils.getURL("classpath:").getPath());
os = response.getOutputStream();
bis = new BufferedInputStream(response.getClass().getClassLoader().getResourceAsStream("res/test.apk"));
bis = new BufferedInputStream(response.getClass().getClassLoader().getResourceAsStream("file/test.apk"));
int i = bis.read(buff);
while (i != -1) {
os.write(buff, 0, buff.length);
......
......@@ -61,7 +61,7 @@ public class DownLoadController {
/*File file = new File("D:\\file\\test.apk");*/
byte[] body = null;
/*InputStream in = new FileInputStream(file);*/
InputStream in = getClass().getClassLoader().getResourceAsStream("res/cc.apk");
InputStream in = getClass().getClassLoader().getResourceAsStream("file/test.apk");
OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
//创建存放文件内容的数组
byte[] buff = new byte[1024];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论