Length-prefix message framing for streams in C#