docs: public static long copy(final InputStream input,
                             final OutputStream output,
                             final byte buffer[])
           throws IOException {
        long total = 0;
        int read;
  
        if (trace) {
           log.tracef("copying %s to %s with buffer size: %d", input, output, buffer.length);
        }
  
        while ((read = input.read(buffer)) != -1) {
           output.write(buffer, 0, read);
           total += read;
  
           if (trace) {
              log.tracef("bytes read: %d; total bytes read: %d", read, total);
           }
        }
  
        return total;
     }