klyn.io.toml.TOML.save
method
public static save(writer as TextWriter, document as Map<String, Object>) as Void throws IOException, TOMLWriteException:
Description

Writes a root table to an existing text writer.

The writer remains owned by the caller and is not closed by this method.

Parameters
ParameterDescription
writerDestination text writer.
documentRoot TOML table.
Throws
  • IOException if the writer fails.
  • TOMLWriteException if a value cannot be represented by TOML.
Example
try writer = FileWriter("config.toml"):
TOML.save(writer, {"port": 8080l})