It would be great if the jsonmarshaller provided some form of support for
unmarshalling streams.
This is one way I could see this working:
For the input:
[
{"type": "foo", "fooValue": 1},
//pause
{"type": "bar", "barValue": "abc"},
//pause
{"type": "baz", "bazValue": false}
]
Code along these lines would provide streaming unmarshalling:
InputStream is = //...;
TwoLattes.createMarshaller(FooBarBaz.class).streamingUnmarshallList(is,
new EntityCallback<FooBarBaz>() {
void callback(FooBarBaz entity) {
//yields individual instances of FooBarBaz from the provided input stream
}
});
Original issue reported on code.google.com by dfortun...@gmail.com on 21 Apr 2010 at 9:44
Original issue reported on code.google.com by
dfortun...@gmail.com
on 21 Apr 2010 at 9:44