code: @Override
    public void close() throws IOException {
      checkState(isInitialized, "initialize() must be invoked before use.");
      if (isOpen()) {
        try {
          pipeSinkChannel.close();
          handleResponse(waitForCompletionAndThrowIfUploadFailed());
        } finally {
          pipeSinkChannel = null;
          uploadOperation = null;
        }
      }
    }
docs: Closes this channel.
  
  <p>Note: The method returns only after all data has been successfully written to GCS or if
  there is a non-retry-able error.
  
  @throws IOException on IO error