public Section open(int position) {
    if (position < 0 || position >= data.capacity()) {
      throw new IllegalArgumentException("position=" + position + " length=" + data.capacity());
    }
    ByteBuffer sectionData = data.duplicate();
    sectionData.order(ByteOrder.LITTLE_ENDIAN); // necessary?
    sectionData.position(position);
    sectionData.limit(data.capacity());
    return new Section("section", sectionData);
  }
It is the caller's responsibility to close {@code in}.
android/android_framework/dex-maker/src/main/java/com/android/dex/Dex.java