I'm currently writing my own simple filereader for binary files and I'm currently a bit stuck.
So far parsing the file, and reading the header with what the file contains and the data itself works great, but I'm currently a bit confused on how to convert the bytes (big-endian) of the data (which are now stored in a char-Vector) back to their corresponding Integers and Floats.
I understand the principle, if I have for example a 32-bit Integer, I take packets of four chars and a signed int32, shift the int by 8, add the first char, then shift it again, add the 2nd etc., the same for the other ones.
1) So my first question is, is there a fast way to do this, for the whole vector at once, or do I have to iterate it over it (since it can be up to several hundreds of megabytes)?
2) My 2nd question is, how do I do it for the 24bit integers and the floats? There it isn't that clear for me on how to do it, same procedure as for the integers?
Best Regards!