my dog learned polymorphism*
The moose likes Tomcat and the fly likes does CoyoteOutputStream write it chunks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "does CoyoteOutputStream write it chunks" Watch "does CoyoteOutputStream write it chunks" New topic
Author

does CoyoteOutputStream write it chunks

Smo Nerona
Greenhorn

Joined: May 19, 2011
Posts: 2
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does CoyoteOutputStream write it chunks
 
Similar Threads
sending large files through webservice
Specific Attachment Problem...
Remote JNDI/EJB Problem
sendRedirect() method
Reading files of size >100MB