hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bogdan Mihaila <bm2004...@yahoo.com>
Subject response body as stream
Date Tue, 24 Jan 2006 10:56:49 GMT
Hello!
   
  I try to download ZIP files with httpclient, and I want to get the response as stream, not
as byte[]... It downloades the files (the sizes are Ok), but when I open the archives It gives
me: "error in packed file" and "invalid bit length repeat". 
   
  I use the following code:
   
            Reader reader = new InputStreamReader(
                  method.getResponseBodyAsStream(), method.getResponseCharSet()); 
   
            //  I use the Commons IO package
   
                   BufferedWriter out = new BufferedWriter(new FileWriter("...."));
                 out.write(IOUtils.toString(reader));
                 out.close();
   
  What can be the problem?
   
  Thanks in advance
   

		
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used
cars.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message