Configure protobuf decoding limits
See:
https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedInputStream#Google_Protobuf_CodedInputStream_RecursionLimit
Seems this limits are not exposed with the ReadOnlySequence API we are using
Looking at the C# protobuf API and sources, the decoding limits can only be set with the CodecInputStream API, the ParseContext used by other overloads always uses the default limits.
If we want to use the CodecInputStream API, we need to wrap the ReadOnlySequence in a Stream and then create the CodecInputStream with the desired limits using CreateWithLimits https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.CodedInputStream#Google_Protobuf_CodedInputStream_CreateWithLimits_System_IO_Stream_System_Int32_System_Int32_
This means an additional allocation for the stream wrapping the read-only sequence.
See a related issue in the grpc-dotnet repository:
- https://github.com/grpc/grpc-dotnet/issues/1983
I'd rather not wrap CodecInputStream.
Since this is a Protobuf C# issue, should we open an issue in https://github.com/protocolbuffers/protobuf/issues?q=is%3Aopen+is%3Aissue+label%3Ac%23?