encodeLengthPrefixedMessage should match decodeLengthPrefixedMessage