mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-12-29 11:42:15 +00:00
Added an example for each TomlWriter#write method
This commit is contained in:
parent
3a3915416a
commit
d9964fd61a
1 changed files with 8 additions and 2 deletions
10
README.md
10
README.md
|
@ -243,10 +243,16 @@ class AClass {
|
|||
int[] anArray = { 2, 3 };
|
||||
}
|
||||
|
||||
String tomlString = new TomlWriter().write(new AClass());
|
||||
TomlWriter tomlWriter = new TomlWriter();
|
||||
AClass obj = new AClass();
|
||||
String tomlString = tomlWriter.write(obj);
|
||||
tomlWriter.write(obj, new File("path/to/file"));
|
||||
tomlWriter.write(obj, new ByteArrayOutputStream());
|
||||
tomlWriter.write(obj, new OutputStreamWriter(anOutputStream));
|
||||
|
||||
/*
|
||||
yields:
|
||||
All methods yield:
|
||||
|
||||
anInt = 1
|
||||
anArray = [ 2, 3 ]
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue