On Mar 25, 2012, at 18:09 , Galileo Sanchez wrote:
> 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,
# 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
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at