in reply to Re^3: Geo Package files
in thread Geo Package files

You should wind up with something like: 47 50 XX YY... 0x47 means "G" and 0x50 means "P"

Just as a general question...
Why would the file specification require 0x4750 at the start of the file?
What does it add?

Is it just there so that any processor of the file can fail quickly if it is passed a file that doesn't start with these two bytes or is there more to it than that?

  • Comment on Fixed starting bytes (was: Re^4: Geo Package files)

Replies are listed 'Best First'.
Re: Fixed starting bytes (was: Re^4: Geo Package files)
by Marshall (Canon) on Mar 12, 2022 at 20:12 UTC
    This is a common protocol feature. For example a .WAV file starts with WAVE - the letters RIFF can also appear. Using ASCII letters makes it easy to see that you have the right kind of format just by inspection (if you deal with ASCII often). Often binary dump views will display the ASCII if it is within normal "printable" character range as added info. This is also helpful to make sure that you are at a "proper beginning". Decoding the thing requires being certain that you are at a valid byte(0) because all field definitions are a delta to that byte's "address". So this is a cheap (very little bandwidth), "sanity check". This is also often seen with communication links and can assist with resynchronization when some data "goes missing".