protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

[C#] Allow reuse of CodedInputStream and CodedOutputStream

Open yufeih opened this issue 7 years ago • 4 comments

CodedOutputStream can take use flat array as the output. This is a great to just convert between object and bytes. Problem is an instance of CodedOutputStream can only be used once.

Adding a Reset method allows you to reuse the same CodedOutputStream to serialize different objects.

Same is true for CodedInputStream.

See https://github.com/yufeih/protobuf/commit/d6ffc2f37cad8e85cbd71b1d144093250894aeb8

yufeih avatar Aug 20 '16 08:08 yufeih