If you header did indeed consist of a single byte to indicate message type and then 8 bytes to indicate data length, you'd call ReadByte to get the message type and then ReadInt64 to get the data length.