private Annotations parseAnnotations(AnnotationVisibility visibility) throws IOException {
    int count = input.readUnsignedShort();

    if (observer != null) {
      parsed(2, "num_annotations: " + Hex.u2(count));
    }

    Annotations annotations = new Annotations();

    for (int i = 0; i < count; i++) {
      if (observer != null) {
        parsed(0, "annotations[" + i + "]:");
        changeIndent(1);
      }

      Annotation annotation = parseAnnotation(visibility);
      annotations.add(annotation);

      if (observer != null) {
        observer.changeIndent(-1);
      }
    }

    annotations.setImmutable();
    return annotations;
  }
Parses an annotation list.

@param visibility {@code non-null;} visibility of the parsed annotations
@return {@code non-null;} the list of annotations read from the attribute data
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/direct/AnnotationParser.java