The 4 bytes are a base 256 number representing
the length of the message. As I recall there is a difference in byte
order between the SOUP binary format and Yarn's format. In Soup binary,
the decimal length of the message is given by (in BASIC)
ascii(mid$(m$,1,1))*256*256*256 + ascii(mid$(m$,2,1))*256*256_
+ ascii(mid$(m$,3,1))*256 + ascii(mid$(m$,4,1))
where the message format is m$ = b0b1b2b3message_starts_here...
I believe (but have not verified) that the order in Yarn is little-endian,
so the length is
ascii(mid$(m$,3,1))*256*256*256 + ascii(mid$(m$,4,1))*256*256_
+ ascii(mid$(m$,2,1))*256 + ascii(mid$(m$,1,1))
In C the corresponding functions would be asc and substr I suppose.
-rex