hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27366] - GetMethod.getResponseBodyAsStream() .available() could return content-length
Date Mon, 08 Mar 2004 21:16:27 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27366>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27366

GetMethod.getResponseBodyAsStream() .available() could return content-length





------- Additional Comments From armhold@cs.rutgers.edu  2004-03-08 21:16 -------
> I do not think we should violate standard Java API even in such a
> subtle manner.  The purpose of InputStream#available() method is
> different and we should not get too creative about Java API.

I agree that the available() method is not documented to mean "length
of stream", however even Java's own ProgressMonitorInputStream uses it
this way.  Gosling wrote that class, and in it he sets size =
available().  If available() only returns the amount of data currently
buffered, the ProgressMonitor does nothing useful.  I guess it would
have been nice if the InputStream base class had a "length()" method
as well.  

Anyway, I can implement the behavior by writing an extension class, so
no need for you to violate the API in HttpClient.  Feel free to close
this enhancement request, and thanks for your consideration.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message