Pom.xml配置
commons-io commons-io2.6
流的调用
//读取文件数据 FileInputStream fileInputStream = new FileInputStream("C://Users//86152//Videos//Captures//8608a8fd6e9a3ba0aef49703c5e1ff03.mp4"); //获取response字节输出流 ServletOutputStream outputStream = response.getOutputStream(); //完成流的copy // byte[] buff = new byte[1024]; // int len = 0; // while ((len = fileInputStream.read(buff)) != -1){ // outputStream.write(buff,0,len); // } IOUtils.copy(fileInputStream,outputStream); fileInputStream.close();
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)