I have a packet stream where parsing of a packet depends on a variable in the first packet. Since it is a stream I can not parse the whole dataset at once. So what I want is is store these variable and use them as input to the following packets/parsers.
E.g. something like this
let bytesPerSample = 4; // read in the first header packet
const result = myParser.parse(buffer, {bytesPerSample }) // Parser take an optional parseroptions
Thanks for a good tool.
I have a packet stream where parsing of a packet depends on a variable in the first packet. Since it is a stream I can not parse the whole dataset at once. So what I want is is store these variable and use them as input to the following packets/parsers.
E.g. something like this