@NotNull
  static HashMapZipFile createHashMapZipFile(@NotNull ByteBuffer buffer,
                                             int fileSize,
                                             int entryCount,
                                             int centralDirSize,
                                             int centralDirPosition) throws EOFException {
    // ensure the table is even length
    if (entryCount == 65535) {
      // it means that more than 65k entries - estimate the number of entries
      entryCount = centralDirPosition / 47 /* min 46 for entry and 1 for filename */;
    }
    ImmutableZipEntry[] entries = new ImmutableZipEntry[entryCount];

    int entrySetLength = entryCount * 2 /* expand factor */;
    ImmutableZipEntry[] entrySet = new ImmutableZipEntry[entrySetLength];

    int fileEntryCount = readCentralDirectory(buffer, centralDirPosition, centralDirSize, entrySet, entries);
    if (entries.length != fileEntryCount) {
      ImmutableZipEntry[] resizedEntries = new ImmutableZipEntry[fileEntryCount];
      System.arraycopy(entries, 0, resizedEntries, 0, fileEntryCount);
      entries = resizedEntries;
    }

    buffer.clear();
    return new HashMapZipFile(entrySet, entries, buffer, fileSize);
  }
@NotNull
  static HashMapZipFile createHashMapZipFile(@NotNull ByteBuffer buffer,
                                             int fileSize,
                                             int entryCount,
                                             int centralDirSize,
                                             int centralDirPosition)