docs: private void readFields() throws IOException, ClassfileFormatException {
          // Fields
          final int fieldCount = inputStreamOrByteBuffer.readUnsignedShort();
          for (int i = 0; i < fieldCount; i++) {
              // Info on modifier flags: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.5
              final int fieldModifierFlags = inputStreamOrByteBuffer.readUnsignedShort();
              final boolean isPublicField = ((fieldModifierFlags & 0x0001) == 0x0001);
              final boolean isStaticFinalField = ((fieldModifierFlags & 0x0018) == 0x0018);
              final boolean fieldIsVisible = isPublicField || scanSpec.ignoreFieldVisibility;
              final boolean getStaticFinalFieldConstValue = scanSpec.enableStaticFinalFieldConstantInitializerValues
                      && isStaticFinalField && fieldIsVisible;
              if (!fieldIsVisible || (!scanSpec.enableFieldInfo && !getStaticFinalFieldConstValue)) {
                  // Skip field
                  inputStreamOrByteBuffer.readUnsignedShort(); // fieldNameCpIdx
                  inputStreamOrByteBuffer.readUnsignedShort(); // fieldTypeDescriptorCpIdx
                  final int attributesCount = inputStreamOrByteBuffer.readUnsignedShort();
                  for (int j = 0; j < attributesCount; j++) {
                      inputStreamOrByteBuffer.readUnsignedShort(); // attributeNameCpIdx
                      final int attributeLength = inputStreamOrByteBuffer.readInt(); // == 2
                      inputStreamOrByteBuffer.skip(attributeLength);
                  }
              } else {
                  final int fieldNameCpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                  final String fieldName = getConstantPoolString(fieldNameCpIdx);
                  final int fieldTypeDescriptorCpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                  final char fieldTypeDescriptorFirstChar = (char) getConstantPoolStringFirstByte(
                          fieldTypeDescriptorCpIdx);
                  String fieldTypeDescriptor;
                  String fieldTypeSignature = null;
                  fieldTypeDescriptor = getConstantPoolString(fieldTypeDescriptorCpIdx);
  
                  Object fieldConstValue = null;
                  AnnotationInfoList fieldAnnotationInfo = null;
                  final int attributesCount = inputStreamOrByteBuffer.readUnsignedShort();
                  for (int j = 0; j < attributesCount; j++) {
                      final int attributeNameCpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                      final int attributeLength = inputStreamOrByteBuffer.readInt(); // == 2
                      // See if field name matches one of the requested names for this class, and if it does,
                      // check if it is initialized with a constant value
                      if ((getStaticFinalFieldConstValue)
                              && constantPoolStringEquals(attributeNameCpIdx, "ConstantValue")) {
                          // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.2
                          final int cpIdx = inputStreamOrByteBuffer.readUnsignedShort();
                          if (cpIdx < 1 || cpIdx >= cpCount) {
                              throw new ClassfileFormatException("Constant pool index " + cpIdx
                                      + ", should be in range [1, " + (cpCount - 1)
                                      + "] -- cannot continue reading class. "
                                      + "Please report this at https://github.com/classgraph/classgraph/issues");
                          }
                          fieldConstValue = getFieldConstantPoolValue(entryTag[cpIdx], fieldTypeDescriptorFirstChar,
                                  cpIdx);
                      } else if (fieldIsVisible && constantPoolStringEquals(attributeNameCpIdx, "Signature")) {
                          fieldTypeSignature = getConstantPoolString(inputStreamOrByteBuffer.readUnsignedShort());
                      } else if (scanSpec.enableAnnotationInfo //
                              && (constantPoolStringEquals(attributeNameCpIdx, "RuntimeVisibleAnnotations")
                                      || (!scanSpec.disableRuntimeInvisibleAnnotations && constantPoolStringEquals(
                                              attributeNameCpIdx, "RuntimeInvisibleAnnotations")))) {
                          // Read annotation names
                          final int fieldAnnotationCount = inputStreamOrByteBuffer.readUnsignedShort();
                          if (fieldAnnotationCount > 0) {
                              if (fieldAnnotationInfo == null) {
                                  fieldAnnotationInfo = new AnnotationInfoList(1);
                              }
                              for (int k = 0; k < fieldAnnotationCount; k++) {
                                  final AnnotationInfo fieldAnnotation = readAnnotation();
                                  fieldAnnotationInfo.add(fieldAnnotation);
                              }
                          }
                      } else {
                          // No match, just skip attribute
                          inputStreamOrByteBuffer.skip(attributeLength);
                      }
                  }
                  if (scanSpec.enableFieldInfo && fieldIsVisible) {
                      if (fieldInfoList == null) {
                          fieldInfoList = new FieldInfoList();
                      }
                      fieldInfoList.add(new FieldInfo(className, fieldName, fieldModifierFlags, fieldTypeDescriptor,
                              fieldTypeSignature, fieldConstValue, fieldAnnotationInfo));
                  }
              }
          }
      }