4445464748495051525354
writer.writeValue(33); writer.writeKey("name"); writer.writeValue("jobs"); writer.writeEndObject(); writer.flush(); Assert.assertEquals("{\"id\":33,\"name\":\"jobs\"}", out.toString()); }
6667686970717273747576
writer.writeKey("children"); writer.writeStartArray(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject(); writer.writeEndArray();
6970717273747576777879
writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject(); writer.writeEndArray(); writer.writeEndObject(); writer.flush();
7374757677787980818283
writer.writeStartObject(); writer.writeEndObject(); writer.writeEndArray(); writer.writeEndObject(); writer.flush(); Assert.assertEquals("{\"id\":33,\"name\":\"jobs\",\"children\":[{},{}]}", out.toString()); }
8788899091929394959697
JSONWriter writer = new JSONWriter(out); writer.writeStartArray(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartArray();
90919293949596979899100
writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartArray(); writer.writeEndArray(); { writer.writeStartArray();