javasizebufferbufferedinputstream

Buffer Size for BufferedInputStream


How to determine the size of Buffer, while using Buffered Input Stream for reading batch of files? Is it based on the File size?I'm using,

byte[] buf = new byte[4096];

If i increase the buffer size,it will read quickly?


Solution

  • The default, which is deliberately undocumented, is 8192 bytes. Unless you have a compelling reason to change it, don't change it.