mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-06-10 21:55:10 +00:00
Added an example for each TomlWriter#write method
This commit is contained in:
parent
3a3915416a
commit
d9964fd61a
10
README.md
10
README.md
|
@ -243,10 +243,16 @@ class AClass {
|
||||||
int[] anArray = { 2, 3 };
|
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
|
anInt = 1
|
||||||
anArray = [ 2, 3 ]
|
anArray = [ 2, 3 ]
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue