code: public static void write(KeePassFile keePassFile, String password, OutputStream stream) {
          if (stream == null) {
              throw new IllegalArgumentException("You must provide a stream to write to.");
          }
  
          new KeePassDatabaseWriter().writeKeePassFile(keePassFile, password, stream);
      }
docs: Encrypts a {@link KeePassFile} with the given password and writes it to
  the given stream.
  <p>
  If the KeePassFile cannot be encrypted an exception will be thrown.
  
  @param keePassFile
  the keePass model which should be written
  @param password
  the password to encrypt the database
  @param stream
  the target stream where the output will be written
  @see KeePassFile