title: Getting a zip file with a java rest client (restEasy)
body: <p>everyone.</p>
  
  <p>I started to use the restEasy (jboss) java rest client and met a problem I cannot seem to solve.
  So far, I could use it to bring back json from the rest server (string form).
  One of the rest service I need brings back a zip file, however. And I stumbled on a problem.
  Here is the code : </p>
  
  <pre><code>ClientRequest req = new ClientRequest("rest service url"); //the url is good
  
  ClientResponse&lt;String&gt; res = null;
  
  res = req.get(String.class);
  
  ZipInputStream zip = new ZipInputStream(new 
          ByteArrayInputStream(res.getEntity().getBytes()));
  
  ZipEntry zipEntry = zip.getNextEntry();
          System.out.println(zipEntry.getName()); 
     //here, I print the name of the first file in my archive, so, I seem to have a    
     // zip file indeed
  
  String jsonString = IOUtils.toString(zip); 
     //bam, this is causing a zipException : invalid block type
  </code></pre>
  
  <p>Google told me that it was the correct way to read a zip file. I tried to read it byte by byte, too, and It throws the sams exception on zip.read().</p>
  
  <p>Did I do something wrong? 
  What Should I do to read the content of my file? </p>
  
  <p>I would be gratefull for any insight on that matter.
  Thanks</p>
  
  <p>P.S : Sorry if I sound strange, English is not my first language.</p>