code: public void setClobValue(long locator, Reader data) throws PersistException, IOException {
          if (data == null) {
              deleteLob(locator);
              return;
          }
  
          if (locator == 0) {
              throw new IllegalArgumentException("Cannot use locator zero");
          }
  
          Transaction txn = mRepo.enterTransaction(IsolationLevel.READ_COMMITTED);
          txn.setForUpdate(true);
          try {
              StoredLob lob = mLobStorage.prepare();
              lob.setLocator(locator);
              try {
                  lob.load();
              } catch (FetchNoneException e) {
                  throw new PersistNoneException("Lob deleted: " + this);
              }
  
              ClobImpl clob = new ClobImpl(lob);
              Writer writer = clob.openWriter(0, 0);
  
              char[] buffer = new char[lob.getBlockSize() >> 1];
  
              long total = 0;
              int amt;
              try {
                  while ((amt = data.read(buffer)) > 0) {
                      writer.write(buffer, 0, amt);
                      total += amt;
                  }
              } finally {
                  data.close();
              }
              writer.close();
  
              if (total < lob.getLength()) {
                  clob.setLength(total);
              }
  
              txn.commit();
          } catch (IOException e) {
              if (e.getCause() instanceof RepositoryException) {
                  RepositoryException re = (RepositoryException) e.getCause();
                  throw re.toPersistException();
              }
              throw e;
          } catch (FetchException e) {
              throw e.toPersistException();
          } finally {
              txn.exit();
          }
      }
docs: Stores a value into a Clob, replacing anything that was there
  before. Passing null deletes the Clob, which is a convenience for
  auto-generated code that may call this method.
  
  @param locator lob locator as created by createNewClob
  @param data source of data for Clob, which may be null to delete
  @throws IllegalArgumentException if locator is zero