Hi B K,

> to return the inputstream. I now have a requirement to determine how
> large the compressed response is(to determine bandwidth usage), as the
> server is not returning content-length I thought I would do the following
> 
> create a string buffer
> create a buffered reader for getResponseBodyAsStream()
> read the response and append to my string buffer

As Robert pointed out, you have issues with character vs binary data
and you are clogging memory with this approach. Instead of just wrapping
the GZIPInputStream, you can implement your own wrapper stream that counts
the number of bytes being read, then wrap the GZIPInputStream on top of
that. Use java.io.FilterInputStream as a starting point and override all
read() and skip() methods to count the number of bytes.

hope that helps,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to