code: public void done() throws JsonWriterException {
      super.doneInternal();
      if (appendable instanceof Flushable) {
        try {
          ((Flushable) appendable).flush();
        } catch (IOException e) {
          throw new JsonWriterException(e);
        }
      }
    }
docs: Closes this JSON writer and flushes the underlying {@link Appendable} if it is also {@link Flushable}.
  
  @throws JsonWriterException
  if the underlying {@link Flushable} {@link Appendable} failed to flush.