BTW, if determining the end of the stream is a problem, you can write out the Seq and then a null. The non the deserialization side, you read up to the null.