DsFileReader Seek issue with values >= (2^63 - 2^10)
Show older comments
I am using DsFileReader to read .mf4 files (ASAM MDF spec files).
One of my files has some corrupted values that return locations well outside the range. Strangely, when calling seek(), DSFileReader can handle them until the value exceeds (2^63-2^10-1). For reference, this file claimes the size is 141397456 (under 2^27). If I try to seek to (2^63 - 2^10) then it will fail.
When the error occurs, I get ByteStreamSeekFailure: iostream stream error. This error is not caught by any Try/Catch, and doesn't have a code, so tracking down the issue is much tougher. I have managed to track it to the call of fr.Stream.seek(bytes, originNum); within the seekWithParsedInputs() function, and I can see the Stream is created as a matlab.io.internal.vfs.stream object, but those files don't appear browsable.
While I know my file is corrupted, I wanted to understand when to expect this non-trackable error so I can make sure any fix for where I am seeking will work and send a proper error before this non-sourced error. (also it's odd that 2^64-2^10 is the magic error threshold, I think it has to do with the biggest integer below 64 bits that Double can represent)
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!