[{"foo":"bar"}]
는
이 같은 대한 코드 싶습니다 :
try(JsonGenerator writer = Json.createGenerator(new FileOutputStream(this.file))){
writer.writeStartObject().write("hello", "world").writeEnd();
} catch (IOException e) {
e.printStackTrace();
}
그리고 결국 구하십시오
[
{"foo":"bar"},
{"hello":"world"}
]
참고 : 내 데이터를 추가하기 위해 전체 json 메모리를로드하지 않아도됩니다.