Hi Dave,
We don't start with 0x1, we start with '1'. Here's why:
From the grammar, the first 4 bytes of a document are going to be a 32
bit integer representing the number of bytes in the document. The
first example is 22 bytes long, which is 16 in hex. So far so good.
The second example is a bit more subtle. The document in the second
example is 49 bytes long. You'd think, then, that the second example
would begin with \x31, since 49 is 31 in hex. Turns out it actually
does. 49 is also the character code for the character '1' in UTF-8
(and ASCII), so when the encoding is represented as a byte string (as
in the example) it's _rendered_ as '1'.
Make sense?