private void requireLength(int requiredLength) throws IOException {
    if (input.available() < requiredLength) {
      throw new ParseException("truncated annotation attribute");
    }
  }
Helper which will throw an exception if the given number of bytes is not available to be read.

@param requiredLength the number of required bytes
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/direct/AnnotationParser.java