On Wed, 2008-04-02 at 21:55 +0200, Sebastiaan van Erk wrote:
> Hi,
> 
> I have a question on the chunked output stream: one of the nice things 
> about chunked encoding is that you can send your data in little parts. 
> However, flush() on ChunkedOutputStream does not flush the buffer:
> 
>      /**
>       * Flushes the underlying stream, but leaves the internal buffer alone.
>       * @throws IOException
>       */
>      public void flush() throws IOException {
>          this.out.flush();
>      }
> 
> This is kind of against the spec of flush on OutputStream:
> 
>      /**
>       * Flushes this output stream and forces any buffered output bytes
>       * to be written out. The general contract of <code>flush</code> is
>       * that calling it is an indication that, if any bytes previously
>       * written have been buffered by the implementation of the output
>       * stream, such bytes should immediately be written to their
>       * intended destination.
>       * ...
> 
> I was wondering what the motivation was behind disabling the flush() 
> option?

To avoid tiny chunks if for some reason the output stream gets flushed
too often. 

Feel free to open a bug in JIRA for this issue.

Oleg

>  Generally if a client does not want to flush the data they won't 
> call flush, which will cause all the chunks to attain the full chunk 
> size anyway...
> 
> Regards,
> Sebastiaan
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to