code: @Nonnull
    public final ESuccess dumpDatabase (@Nonnull @WillClose final OutputStream aOS)
    {
      ValueEnforcer.notNull (aOS, "OutputStream");
  
      // Save the DB data to an SQL file
      try
      {
        LOGGER.info ("Dumping database '" + getDatabaseName () + "' to OutputStream");
        try (final PrintWriter aPrintWriter = new PrintWriter (new NonBlockingBufferedWriter (StreamHelper.createWriter (aOS,
                                                                                                                         StandardCharsets.UTF_8))))
        {
          final DBExecutor aExecutor = new DBExecutor (this);
          final ESuccess ret = aExecutor.queryAll ("SCRIPT SIMPLE", aCurrentObject -> {
            if (aCurrentObject != null)
            {
              // The value of the first column is the script line
              aPrintWriter.println (aCurrentObject.get (0).getValue ());
            }
          });
          aPrintWriter.flush ();
          return ret;
        }
      }
      finally
      {
        StreamHelper.close (aOS);
      }
    }
docs: Dump the database to the passed output stream and closed the passed output
  stream.
  
  @param aOS
  The output stream to dump the DB content to. May not be
  <code>null</code>. Automatically closed when done.
  @return <code>true</code> upon success, <code>false</code> if an error
  occurred.