Reading JSON in a streaming way

This post explain how to stream a json file. We need to create an instance of JsonFactory, as shown below JsonFactory jsonFactory = new JsonFactory(); by which we can create a parser instance (i.e., JsonParser) to read the json file, as shown below JsonParser jsonParser = jsonFactory.createParser(file); Each element whether start and end of the…… Continue reading Reading JSON in a streaming way

Reading json data in streaming way

This post explains how to read json data as a stream. The previous post explains the same using JsonReader. The difference is that to use JsonReader we need to build the entire object (which represents json data) in memory. Whereas with JsonParser we dont need to build the entire object. The below code explains how…… Continue reading Reading json data in streaming way

Writing JSON Data in a streaming way

This post explains how to write json data to a file using JsonGenerator. The previous post explains the same using JsonWriter. The difference is that to use JsonWriter we need to build the entire object (which represents json data) in memory before writing to a file. Whereas with JsonGenerator we dont need to build the…… Continue reading Writing JSON Data in a streaming way