code: @Override
      public void discardOutput() throws IllegalStateException, IOException{
          // validate state
          if (isClosed())
                  throw new IllegalStateException("Serial connection is not open; cannot 'discardOutput()'.");
  
          // flush data to serial port immediately
          com.pi4j.jni.Serial.discardOutput(fileDescriptor);
      }
docs: <p>
  Discards any data in the serial transmit (output) buffer.
  Please note that this does not force the transmission of data, it discards it!
  </p>
  
  @throws IllegalStateException thrown if the serial port is not already open.
  @throws IOException thrown on any error.