i2psnark: Larger read buffer for large files

This commit is contained in:
zzz
2020-11-10 14:54:37 +00:00
parent c908c6bd05
commit 989f64192f

View File

@ -472,6 +472,8 @@ class BasicServlet extends HttpServlet
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public InputStream getInputStream() throws IOException public InputStream getInputStream() throws IOException
{ {
if (getContentLength() > 4*1024*1024)
return new BufferedInputStream(new FileInputStream(_file), 64*1024);
return new BufferedInputStream(new FileInputStream(_file)); return new BufferedInputStream(new FileInputStream(_file));
} }