encodeTo

fun TomlMapper.encodeTo(output: Appendable, value: Any)

Serializes given value into a valid TOML document and writes it to the given Appendable. If value does not serialize to a valid TOML document (i.e. a map of zero or more keys), an TomlException.SerializationError is thrown.


fun TomlMapper.encodeTo(outputStream: OutputStream, value: Any)

Serializes given value into a valid TOML document and writes it to the given OutputStream. If value does not serialize to a valid TOML document (i.e. a map of zero or more keys), an TomlException.SerializationError is thrown.


fun TomlMapper.encodeTo(path: Path, value: Any)

Serializes given value into a valid TOML document and writes it to the file indicated by the given Path. If value does not serialize to a valid TOML document (i.e. a map of zero or more keys), an TomlException.SerializationError is thrown.