I have an S3 object that contains JsonL lines. I want to read this object line by line in Java so that I can recursively keep parsing each line (i.e, each json) into a POJO and eventually convert the object contents into a list of POJO.
As I understand, AmazonS3.getObject().getObjectContent()
returns a stream to the object's content. My next step is to read a line and convert to string which I can then parse into a POJO. I am not sure how to operate on this InputStream
to keep obtaining the next line in String format.
Sample data :
{"key1":"val", "key2":"val1", "key3":"val2"}
{"key1":"val3", "key2":"val4", "key3":"val5"}
{"key1":"val6", "key2":"val7", "key3":"val8"}