Open aliafshar opened 3 years ago
I mean Deserializer, sorry.
I've just tested and it works fine, quick hack example once _offset
is offset
List<dynamic> deserializeMany(List<int> data) {
final d = Deserializer(data);
final List<dynamic> results = [];
var keepDecoding = true;
while (keepDecoding) {
results.add(d.decode());
keepDecoding = d.offset < data.length;
}
return results;
}
I think that if the offset was available publicly I could parse messages that have become concatenated on a stream like:
By using the offset to split the original byte array. Otherwise I can't think of a sensible way of parsing that. If you are ok with that, and the concept is correct, I am happy to make a PR. For now I will just copy-paste and modify the code.