On Mar 25, 2012, at 18:09 , Galileo Sanchez wrote:
> else 
> if (Should I write the size as a raw bit string?)
> then                        How do I do that?


You need to use something like the following. Not 100% sure it works but it 
should be close? Hope this helps,

Evan


# Output a message to be read with Java's parseDelimitedFrom
import google.protobuf.internal.encoder as encoder
out = message.SerializeToString()
out = encoder._VarintBytes(len(out)) + out


# Read a message from Java's writeDelimitedTo:
import google.protobuf.internal.decoder as decoder

# Read length
(size, position) = decoder._DecodeVarint(buffer, 0)
# Read the message
message_object.ParseFromString(buffer[position:position+size])


--
http://evanjones.ca/

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to