@Override
 public void write(byte[] bs) throws SerialPortException {
   try {
     if (fifo_out.getSize() > 0) {
       flush();
     }
     writeNative(bs);
   } catch (Exception e) {
     storeData(bs);
     logger.warn(
         "Failed to write "
             + new String(bs)
             + " "
             + bs.length
             + " octects on "
             + this.getPort_name());
     pending(500);
     flush();
   }
 }
 @Override
 public void flush() throws SerialPortException {
   if (fifo_out.getSize() > 0) {
     writeNative(fifo_out.removeAll());
   }
 }