示例#1
0
def TagBytes(field_number, wire_type):
    """Encode the given tag and return the bytes.  Only called at startup."""

    return _VarintBytes(wire_format.PackTag(field_number, wire_type))
示例#2
0
def _TagSize(field_number):
  """Returns the number of bytes required to serialize a tag with this field
  number."""
  # Just pass in type 0, since the type won't affect the tag+type size.
  return _VarintSize(wire_format.PackTag(field_number, 0))