文件下载中使用inputStream流获取文件大小
程序员文章站
2023-11-16 17:29:52
inputStream.available()获取的是文件的字节大小 InputStream inputStream = new FileInputStream(new File(path)); response.setHeader("Content-Length", String.valueOf(... ......
inputstream.available()获取的是文件的字节大小
inputstream inputstream = new fileinputstream(new file(path)); response.setheader("content-length", string.valueof(inputstream.available()));
下一篇: Android中的Adapter简单介绍