title: Object vs static method design
body: <p>As shown below, there are two straightforward ways I could make a stream copier (bar introducing Apache Commons or similar). Which one should I go for, and why ?</p>
  
  <pre><code>public class StreamCopier {
  private int bufferSize;
  
  public StreamCopier() {
      this(4096);
  }
  
  public StreamCopier(int bufferSize) {
      this.bufferSize = bufferSize;
  }
  
  public long copy(InputStream in , OutputStream out ) throws IOException{
      byte[] buffer = new byte[bufferSize];
      int bytesRead;
      long totalBytes = 0;
      while((bytesRead= in.read(buffer)) != -1) {
          out.write(buffer,0,bytesRead);
          totalBytes += bytesRead;
      }
  
      return totalBytes;
  }
  }
  </code></pre>
  
  <p>vs    </p>
  
  <pre><code> public class StreamCopier {
  
   public static long copy(InputStream in , OutputStream out)
       throws IOException {
       return this.copy(in,out,4096);
   }
  
   public static long copy(InputStream in , OutputStream out,int bufferSize)
       throws IOException {
       byte[] buffer = new byte[bufferSize];
       int bytesRead;
       long totalBytes = 0;
       while ((bytesRead= in.read(buffer)) != -1) {
           out.write(buffer,0,bytesRead);
           totalBytes += bytesRead;
       }
  
       return totalBytes;
  }
  }
  </code></pre>