Hi @Parth Gupta,
If you follow the algorithm for decompression, you'll see that it uses the total number of compressed bytes in the chunks to determine when the final token sequence ends.
For example, 2.4.1.3.4 Decompressing a TokenSequence shows the algorithm and the test here:
IF CompressedCurrent is LESS THAN CompressedEnd THEN
is what determines if the next byte(s) in the chunk is actually a token or if we've reached the end of the compressed data.
The FlagByte
only tells what kind of token is present but does not tell whether a byte is actually a token in the compressed chunks collection.
Here is a repo that contains working decompression code as an example of following the algorithm and you can use that as a reference if needed:
https://github.com/tomjebo/compvba.git
Hope this helps.
Best regards,
Tom Jebo
Microsoft Open Specifications Support