On Fri, 2015-06-26 at 18:07 +0000, Mark A. Claassen wrote:
> This is from a pretty old thread, but I was called away for a bit.
> 
> > With chunk coded content the end of stream should be generated when the 
> > closing chunk has been read. It looks like your application either does not 
> > read the closing chunk for some reason or something is still amiss.
> 
> I know the size of the transmission before it goes on the socket, but not 
> soon enough to put it in the Http header.  So, I know the exact number of 
> bytes and read exactly that many.  Looking at the EOFSensorInputStream, it 
> looks like it may be helpful for me to call read() one extra time so that the 
> read() on the input stream returns a -1 at some point.
> 
> Would this be advisable?  Or is it ok for me to read just the exact number of 
> bytes I know are there and then close my stream (without read ever returning 
> -1)
> 

It would. Generally I would consider reading to the end of message
content stream a good practice.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to