alexeyxo / protobuf-objc

Google Protocol Buffers for Objective-C
http://protobuf.io/#objc
Apache License 2.0
670 stars 135 forks source link

Encode Delimited #75

Open ido-ran opened 8 years ago

ido-ran commented 8 years ago

I'm writing a client application in iOS that uses ProtocolBuffer with this library. I have a server written with ProtobufJS, there I'm using both encodeDelimited and decodeDelimited which AFAIK write the length of the message before the message.

The problem is I could not find a match methods for length delimited in ProtoBuf-ObjC. Can you help me understand how to do that?

ido-ran commented 8 years ago

I manage to send a delimited message using the following code:

    PBCodedOutputStream *codedOutput = [PBCodedOutputStream streamWithOutputStream:socketConnection.outputStream];
    [codedOutput writeRawVarint32:msg.serializedSize];
    [msg writeToCodedOutputStream:codedOutput];

I can try to fork this repository and add the functionality.