Reading a binary file. ReadAllBytes () array size differs from file size

I have a custom formatted binary that I need to parse and extract information from.

When I open the file with a hex editor , it shows 675 bytes in the file, and the file size in its windows properties windows is also 675 bytes (size on disk: 4KB) .

When I use the C # method File.ReadAllBytes()

, I get an array of 1172 bytes .

I cannot figure out what bytes are present in the array in relation to bytes in the Hex editor.

Why does C # read at 1172 bytes when the file contains 675 bytes ? How can I parse this?

+3


source to share





All Articles