title: Reading website's contents into string
body: <p>Currently I'm working on a class that can be used to read the contents of the website specified by the url. I'm just beginning my adventures with <code>java.io</code> and <code>java.net</code> so I need to consult my design. </p>
  
  <p>Usage:</p>
  
  <pre><code>TextURL url = new TextURL(urlString);
  String contents = url.read();
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>package pl.maciejziarko.util;
  
  import java.io.*;
  import java.net.*;
  
  public final class TextURL
  {
      private static final int BUFFER_SIZE = 1024 * 10;
      private static final int ZERO = 0;
      private final byte[] dataBuffer = new byte[BUFFER_SIZE];
      private final URL urlObject;
  
      public TextURL(String urlString) throws MalformedURLException
      {
          this.urlObject = new URL(urlString);
      }
  
      public String read() 
      {
          final StringBuilder sb = new StringBuilder();
  
          try
          {
              final BufferedInputStream in =
                      new BufferedInputStream(urlObject.openStream());
  
              int bytesRead = ZERO;
  
              while ((bytesRead = in.read(dataBuffer, ZERO, BUFFER_SIZE)) &gt;= ZERO)
              {
                  sb.append(new String(dataBuffer, ZERO, bytesRead));
              }
          }
          catch (UnknownHostException e)
          {
              return null;
          }
          catch (IOException e)
          {
              return null;
          }
  
          return sb.toString();
      }
  
      //Usage:
      public static void main(String[] args)
      {
          try
          {
              TextURL url = new TextURL("http://www.flickr.com/explore/interesting/7days/");
              String contents = url.read();
  
              if (contents != null)
                  System.out.println(contents);
              else
                  System.out.println("ERROR!");
          }
          catch (MalformedURLException e)
          {
              System.out.println("Check you the url!");
          }
      }
  }
  </code></pre>
  
  <p>My question is: 
  Is it a good way to achieve what I want? Are there any better solutions?</p>
  
  <p>I particularly didn't like <code>sb.append(new String(dataBuffer, ZERO, bytesRead));</code> but I wasn't able to express it in a different way. Is it good to create a new String every iteration? I suppose no.</p>
  
  <p>Any other weak points?</p>
  
  <p>Thanks in advance!</p>