title: How do I use HttpClient in Java to retrieve a binary file?
body: <p>At the moment I can retrieve a text page as follows</p>
  
  <pre><code>    HttpClient client = new DefaultHttpClient();
      HttpGet get = new HttpGet(
              "http://google.com");
  
      try {
  
  
          HttpResponse response = client.execute(get);
          BufferedReader rd = new BufferedReader(new InputStreamReader(
                  response.getEntity().getContent()));
  
          String line = "";
          while ((line = rd.readLine()) != null) {
              System.out.println(line);
  
  
          }
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>Suppose get is targeted at a binary file.  How would I save this correctly to disk?</p>