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...


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

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

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

View raw message