Create ability to serialize a stream.