When sending large files from client to server I found that using httpUrlConnection. setChunkedStreamingMode(65536) made it faster because the server would start receiving files while the client ist still sending it. Probably httpUrlConnection.setFixedLengthStreamingMode(contentLength) also has the same effect. Also, there is less memory use as the entire file does not have to be loaded into memory.
Now on the server side, when sending a large file to client, does it send by blocks/chunks? I found that response.getOutputStream() returns a CoyoteOutputStream. Looking at the source code of this file and OutputBuffer.java, which is in the same package, it looks like perhaps it does send by chunks. But I'm not totally sure.
Out of curiosity, do other web servers also send back by chunks?