code: public static void writeElement(final CodedOutputStream output, final WireFormat.FieldType type, final int number,
              final Object value) throws IOException {
          // Special case for groups, which need a start and end tag; other fields
          // can just use writeTag() and writeFieldNoTag().
          if (type == WireFormat.FieldType.GROUP) {
              output.writeGroup(number, (MessageLite) value);
          } else {
              output.writeTag(number, getWireFormatForFieldType(type, false));
              writeElementNoTag(output, type, value);
          }
      }
docs: Write a single tag-value pair to the stream.
  
  @param output The output stream.
  @param type The field's type.
  @param number The field's number.
  @param value Object representing the field's value. Must be of the exact type which would be returned by
  {@link Message#getField(Descriptors.FieldDescriptor)} for this field.
  @throws IOException Signals that an I/O exception has occurred.