code: public static long copySome(final InputStream input,
                                 final OutputStream output,
                                 final int size,
                                 final long length)
           throws IOException {
        return copySome(input, output, new byte[size], length);
     }
docs: Copy a limited number of bytes from the input stream to the output
  stream.
  
  @param input  Stream to read bytes from.
  @param output Stream to write bytes to.
  @param size   The size of the buffer to use while copying.
  @param length The maximum number of bytes to copy.
  @return The total number of bytes copied.
  @throws IOException Failed to copy bytes.