private boolean processArchive(File file) throws IOException {
    ZipFile zip = new ZipFile(file);

    ArrayList<? extends ZipEntry> entriesList = Collections.list(zip.entries());

    if (sort) {
      Collections.sort(
          entriesList,
          new Comparator<ZipEntry>() {
            @Override
            public int compare(ZipEntry a, ZipEntry b) {
              return compareClassNames(a.getName(), b.getName());
            }
          });
    }

    consumer.onProcessArchiveStart(file);

    ByteArrayOutputStream baos = new ByteArrayOutputStream(40000);
    byte[] buf = new byte[20000];
    boolean any = false;

    for (ZipEntry one : entriesList) {
      final boolean isDirectory = one.isDirectory();

      String path = one.getName();
      if (filter.accept(path)) {
        final byte[] bytes;
        if (!isDirectory) {
          InputStream in = zip.getInputStream(one);

          baos.reset();
          int read;
          while ((read = in.read(buf)) != -1) {
            baos.write(buf, 0, read);
          }

          in.close();
          bytes = baos.toByteArray();
        } else {
          bytes = new byte[0];
        }

        any |= consumer.processFileBytes(path, one.getTime(), bytes);
      }
    }

    zip.close();
    return any;
  }
Processes the contents of an archive ({@code .zip}, {@code .jar}, or {@code .apk}).

@param file {@code non-null;} archive file to process
@return whether any processing actually happened
@throws IOException on i/o problem
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/direct/ClassPathOpener.java