I am trying to determine whether or not a file has been compressed with the GZip protocol.
The consensus seems to be that I need to read the first two bytes of the file, and check that they are equal to 0x1f8b. I have just learned that this is known as a magic number.
How do I, preferably using .Net/C# as this is what I am used to, read the individual bytes of a file?
Thankyou
you could try this…
you might need to use a different variable type for v or you could convert the int…