File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does CoyoteOutputStream write it chunks

 
Smo Nerona
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic