private static void checkBounds(int index, int length) {
    if (index < 0 || index >= length) {
      throw new IndexOutOfBoundsException("index:" + index + ", length=" + length);
    }
  }
Creates a new dex buffer from the dex file {@code file}.
android/android_framework/dex-maker/src/main/java/com/android/dex/Dex.java