/**
   * Writes out the current feature.
   *
   * @throws IOException
   * @see org.geotools.data.FeatureWriter#write()
   */
  public void write() throws IOException {
    // DJB: I modified this so it doesnt throw an error if you
    //     do an update and you didnt actually change anything.
    //     (We do the work)
    if ((live != null)) {
      // We have a modification to record!
      diff.modify(live.getID(), current);

      ReferencedEnvelope bounds = new ReferencedEnvelope((CoordinateReferenceSystem) null);
      bounds.include(live.getBounds());
      bounds.include(current.getBounds());
      fireNotification(FeatureEvent.FEATURES_CHANGED, bounds);
      live = null;
      current = null;
    } else if ((live == null) && (current != null)) {
      // We have new content to record
      //
      diff.add(current.getID(), current);
      fireNotification(
          FeatureEvent.FEATURES_ADDED, ReferencedEnvelope.reference(current.getBounds()));
      current = null;
    } else {
      throw new IOException("No feature available to write");
    }
  }