On Sat, 2010-11-13 at 22:00 +0100, Sebastiano Vigna wrote: > I'm getting literally crazy trying to figure out if and when HttpClient has > closed the connection stream automatically. > > The behaviour existed in 3.1 (AutoCloseInputStream), and I found indications > that HttpClient 4 had solved the problem... well, no. Now it's called > EofSensorWatcher, but the problem is the same: you perform a read() and > instead of -1 you get an exception. > > My question is: how can I know whether the InputStream content of an Entity > returned by a response has been closed automatically?
EofSensorInputStream class automatically releases the underlying input stream as soon as it gets -1 from a read operation. All subsequent read operations will always return -1. The EofSensorInputStream will not throw an exception on a read operation as long as it has not been explicitly closed with #close() method. > I'm getting spurious IOExceptions everywhere. Unfortunately, nobody seems to > have the problem--I couldn't find any relevant information by Googling around. > What kind of spurious IOExceptions are you getting? Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
