hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paranoid" <parano...@ukr.net>
Subject InputStream.close() question
Date Fri, 03 Nov 2006 08:57:40 GMT
hi all!
have a little question...

code:

OutputStream out = new BufferedOutputStream(new FileOutpuStream(targetFile));
GetMethod get = new GetMethod();
HttpClient.getInstance().executeMethod(get);
InputStream in = get.getResponseBodyAsStream();
/* do some job */
out.flush();
out.close(); // works fine, takes 0 millis if testing

in.close(); // this block takes about 48 seconds!!
get.releaseConnection();

look at last 2 lines of code. may be i'm doing something wrong? using
MultiThreaded and need multi-threaded application. there was something in
documentation that i dont need to release
connections - HttpClient will try to reuse it. ok, thats good, but what to do
with inputStream.close() ? i dont need even to close inputStream?

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


Mime
View raw message