code: @Override
      public void flush()
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(this, tc, "flush");
          // Cleanup any pending NACK alarms.  Since we're flushing we don't
          // care about these anymore.
          synchronized (pendingAlarms)
          {
              for (Iterator i = getAlarms(this); i.hasNext();)
              {
                  NRTExpiryHandle next = (NRTExpiryHandle) i.next();
                  next.timer.cancel();
                  i.remove();
              }
          }
  
          // SIB0115
          // If nack alarms are cancelled then deregister the health state for detected gaps
          getControlAdapter().getHealthState().deregister(HealthStateListener.GAP_DETECTED_STATE);
  
          // We shouldn't be flushed if we have pending unacked data.  But
          // just as a sanity check, throw an exception here if we have
          // something undelivered.
          if (oststream
                          .containsState(
                                         new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
                                         TickRange.Value)
              || oststream.containsState(
                                         new TickRange(TickRange.Unknown, 0, RangeList.INFINITY),
                                         TickRange.Uncommitted))
          {
              //TODO: throw some interesting exception
          }
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "flush");
      }
docs: Flush this stream by discarding any nacks we may be waiting on
  (all such ticks automatically become finality). When this
  process is complete, any persistent state for the stream may be
  discarded.
  
  @throws GDException if an error occurs in writeRange.