code: public R uploadAndFinish(InputStream in) throws X, DbxException, IOException {
          return uploadAndFinish(in, null);
      }
docs: Uploads all bytes read from the given {@link InputStream} and returns the response.
  
  This method manages closing this uploader's resources, so no further calls to {@link #close}
  are necessary. The underlying {@code OutputStream} returned by {@link #getOutputStream}
  will be closed by this method.
  
  This method is the equivalent of
  
  <pre><code>
  try {
  OutputStream out = uploader.getOutputStream();
  // read from in, write to out
  response = uploader.finish();
  } finally {
  uploader.close();
  }
  </code></pre>
  
  @param in {@code InputStream} containing data to upload
  
  @return Response from server
  
  @throws X if the server sent an error response for the request
  @throws DbxException if an error occurs uploading the data or reading the response
  @throws IOException if an error occurs reading the input stream.
  @throws IllegalStateException if this uploader has already been closed (see {@link #close}) or finished (see {@link #finish})