docs: public static Object readPrimitiveField(CodedInputStream input, final WireFormat.FieldType type, boolean checkUtf8)
              throws IOException {
          switch (type) {
              case DOUBLE:
                  return input.readDouble();
              case FLOAT:
                  return input.readFloat();
              case INT64:
                  return input.readInt64();
              case UINT64:
                  return input.readUInt64();
              case INT32:
                  return input.readInt32();
              case FIXED64:
                  return input.readFixed64();
              case FIXED32:
                  return input.readFixed32();
              case BOOL:
                  return input.readBool();
              case STRING:
                  if (checkUtf8) {
                      return input.readStringRequireUtf8();
                  } else {
                      return input.readString();
                  }
              case BYTES:
                  return input.readBytes();
              case UINT32:
                  return input.readUInt32();
              case SFIXED32:
                  return input.readSFixed32();
              case SFIXED64:
                  return input.readSFixed64();
              case SINT32:
                  return input.readSInt32();
              case SINT64:
                  return input.readSInt64();
  
              case GROUP:
                  throw new IllegalArgumentException("readPrimitiveField() cannot handle nested groups.");
              case MESSAGE:
                  throw new IllegalArgumentException("readPrimitiveField() cannot handle embedded messages.");
              case ENUM:
                  // We don't handle enums because we don't know what to do if the
                  // value is not recognized.
                  throw new IllegalArgumentException("readPrimitiveField() cannot handle enums.");
          }
  
          throw new RuntimeException("There is no way to get here, but the compiler thinks otherwise.");
      }