parameters: (field_number, is_repeated, is_packed)
docstring: Returns an encoder for a bytes field.
docstring_summary: Returns an encoder for a bytes field.
docstring_tokens: Returns an encoder for a bytes field .
function: def BytesEncoder(field_number, is_repeated, is_packed):
    """Returns an encoder for a bytes field."""
  
    tag = TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED)
    local_EncodeVarint = _EncodeVarint
    local_len = len
    assert not is_packed
    if is_repeated:
      def EncodeRepeatedField(write, value):
        for element in value:
          write(tag)
          local_EncodeVarint(write, local_len(element))
          write(element)
      return EncodeRepeatedField
    else:
      def EncodeField(write, value):
        write(tag)
        local_EncodeVarint(write, local_len(value))
        return write(value)
      return EncodeField
function_tokens: def BytesEncoder ( field_number , is_repeated , is_packed ) : tag = TagBytes ( field_number , wire_format . WIRETYPE_LENGTH_DELIMITED ) local_EncodeVarint = _EncodeVarint local_len = len assert not is_packed if is_repeated : def EncodeRepeatedField ( write , value ) : for element in value : write ( tag ) local_EncodeVarint ( write , local_len ( element ) ) write ( element ) return EncodeRepeatedField else : def EncodeField ( write , value ) : write ( tag ) local_EncodeVarint ( write , local_len ( value ) ) return write ( value ) return EncodeField