Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

does CoyoteOutputStream write it chunks  RSS feed

Smo Nerona
Posts: 2
  • 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, 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?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!