Added an example for each TomlWriter#write method

This commit is contained in:
moandji.ezana 2015-06-29 20:10:43 +02:00
parent 3a3915416a
commit d9964fd61a

View file

@ -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 ]
*/ */