code: private synchronized void uploadCurrentBlock() throws IOException {
      if (!hasActiveBlock()) {
        throw new IllegalStateException("No active block");
      }
      LOG.debug("Writing block # {}", blockCount);
      if (multiPartUpload == null) {
        LOG.debug("Initiating Multipart upload");
        multiPartUpload = new MultiPartUpload();
      }
      try {
        multiPartUpload.uploadBlockAsync(getActiveBlock());
      } finally {
        // set the block to null, so the next write will create a new block.
        clearActiveBlock();
      }
    }
docs: Start an asynchronous upload of the current block.
  
  @throws IOException
  Problems opening the destination for upload or initializing the
  upload