November 2017
Intermediate to advanced
420 pages
10h 29m
English
The following example illustrates Jackson streaming APIs for writing JSON data. This example reads a list of Employee objects, converts them into JSON representations, and then writes to the OutputStream object. The steps are as follows:
OutputStream outputStream = new FileOutputStream("emp-array.json");JsonGenerator jsonGenerator = new JsonFactory().createGenerator(outputStream, JsonEncoding.UTF8);