2
votes

I am sending (protocol buffer) serialized messages from a java application to a .net c# application over a Windows named pipe.

I have compiled a .proto file for both environments. On the c# side, I use protobuf-csharp-port.

I was planning to use length-prefixed packages over the stream.

After reading the messageLength on the c# side, I use CodedInputStream.pushLimit(messageLength). I then wanted to retrieve the actual message using cis.getBytesUntilLimit() in a loop like this:

  do
  {
      builder.mergeFrom(cis);
  } while (cis.getBytesUntilLimit() > 0);

But unfortunately I could not find the method getBytesUntilLimit() in protobuf-csharp-port.

Question: Does getBytesUntilLimit() exist in protobuf-csharp-port? Does protobuf-csharp-port faithfully implement in .net all the JAVA API from Google (or at least the equivalent thereof)?

Thank you.

1

1 Answers

1
votes

Just read the source code of protobuf-csharp-port and noticed a property ReachedLimit. The answer to my question is:

do
{
    builder.MergeFrom(cis);
} while (!cis.IsAtEnd);