Closed ruckc closed 1 year ago
Just realized I based this on main/1.x branch. Updating 2.x now.
Looks like a worthwhile change. The only thought I had (without a proper review) is to check that the BER and BER-OID lengths aren't excessive. If you are trying to deal with potentially corrupted data, then that can cause reading of a really large amount of data from the stream.
Also (for the general case), when things go wrong, the exception doesn't have to go uncaught, and you can log and continue.
Motivation and Context
442 - reference issue. This is just a WIP attempt to provide InputStream parsing in KlvParser.
Description
Added the below method to KlvParser.
Given that
parseBytes()
throws a KlvParseException on bad data, and when dealing with a stream, you may want the ability to continue processing, this required the ability to emit IMisbMessage and/or KlvParseExceptions without breaking the stream.How Has This Been Tested?
I tested with a mock application I'm developing where ffmpeg is running externally and its outputting the KLV data stream to stdout, which is being processed by KlvParser.
Types of changes
Checklist: