Given the following pseudo code. how would I do read in the given data
You can try JBBP
@Bin class Struct { byte [] payload; } @Bin class ParsedStream { Struct [] structs; } ParsedStream parsed = JBBPParser.prepare("structs[_] { ushort size; byte [size] payload; }").parse(theInStream).mapTo(ParsedStream.class);