Take the 2-minute tour ×  What is the sensible buffer size to
use when transferring (irrespective of UP/DOWN) large files (3-4
gigs) with Java?  byte buf[] = new byte[1024]   byte buf[] = new
byte[5 * 1024 * 1024]  Sometimes even if you use a large buffer
and pass to a read(byte array[]) method this doesn't guarantee
you that you will get a full 5 me buffer. In my tests I have
observed that the average size is usually 1.5kb per read()
invocation. Does this make sense performance wise? I'd be glad
if someone could point me to a resource discussing the issue in
greater details.  share|improve this question add comment  2
Answers  up vote 8 down vote accepted  It sounds like you're
reading from a network connection (TCP?)  1500 bytes is the
default Ethernet MTU, which explains why you're typically
getting 1.5KB per read. The MTU can often be increased to 9KB by
configuring the network stacks to use jumbo frames.  With this
in mind, there is almost certainly no point in making buf larger
than 9KB. Using a smaller