code: public void setBlobValue(long locator, Blob data) throws PersistException, IOException {
          if (data == null) {
              deleteLob(locator);
              return;
          }
  
          if (locator == 0) {
              throw new IllegalArgumentException("Cannot use locator zero");
          }
  
          if (data instanceof BlobImpl) {
              BlobImpl impl = (BlobImpl) data;
              if (impl.getEnclosing() == this && impl.mLocator == locator) {
                  // Blob is ours and locator is the same, so nothing to do.
                  return;
              }
          }
  
          try {
              setBlobValue(locator, data.openInputStream(0, 0));
          } catch (FetchException e) {
              throw e.toPersistException();
          }
      }
docs: Stores a value into a Blob, replacing anything that was there
  before. Passing null deletes the Blob, which is a convenience for
  auto-generated code that may call this method.
  
  @param locator lob locator as created by createNewBlob
  @param data source of data for Blob, which may be null to delete
  @throws IllegalArgumentException if locator is zero