exit(-1)
return proto_in
-def DecodeVarint(in_file):
+def _DecodeVarint32(in_file):
"""
The decoding of the Varint32 is copied from
google.protobuf.internal.decoder and is only repeated here to
False if no message could be read.
"""
try:
- size, pos = DecodeVarint(in_file)
+ size, pos = _DecodeVarint32(in_file)
if size == 0:
return False
buf = in_file.read(size)
except IOError:
return False
-def EncodeVarint(out_file, value):
+def _EncodeVarint32(out_file, value):
"""
The encoding of the Varint32 is copied from
google.protobuf.internal.encoder and is only repeated here to
Encoded a message with the length prepended as a 32-bit varint.
"""
out = message.SerializeToString()
- EncodeVarint(out_file, len(out))
+ _EncodeVarint32(out_file, len(out))
out_file.write(out)