def write_field(*args)
      if args.size == 3
        # handles the documented method signature - write_field(field_info, fid, value)
        field_info = args[0]
        fid = args[1]
        value = args[2]
      elsif args.size == 4
        # handles the deprecated method signature - write_field(name, type, fid, value)
        field_info = {:name => args[0], :type => args[1]}
        fid = args[2]
        value = args[3]
      else
        raise ArgumentError, "wrong number of arguments (#{args.size} for 3)"
      end

      write_field_begin(field_info[:name], field_info[:type], fid)
      write_type(field_info, value)
      write_field_end
    end
def write_field(*args)
      if args.size == 3
        # handles the documented method signature - write_field(field_info, fid, value)
        field_info = args[0]
        fid = args[1]
        value = args[2]
      elsif args.size == 4
        # handles the deprecated method signature - write_field(name, type, fid, value)
        field_info = {:name => args[0], :type => args[1]}
        fid = args[2]
        value = args[3]
      else
        raise ArgumentError, "wrong number of arguments (#{args.size} for 3)"
      end

      write_field_begin(field_info[:name], field_info[:type], fid)
      write_type(field_info, value)
      write_field_end
    end
Writes a field based on the field information, field ID and value.

 field_info - A Hash containing the definition of the field:
              :name   - The name of the field.
              :type   - The type of the field, which must be a Thrift::Types constant.
              :binary - A Boolean flag that indicates if Thrift::Types::STRING is a binary string (string without encoding).
 fid        - The ID of the field.
 value      - The field's value to write; object type varies based on :type.

 Returns nothing.