code:     public ZipArchiveEntry getNextZipEntry() throws IOException {
          uncompressedCount = 0;
  
          boolean firstEntry = true;
          if (closed || hitCentralDirectory) {
              return null;
          }
          if (current != null) {
              closeEntry();
              firstEntry = false;
          }
  
          long currentHeaderOffset = getBytesRead();
          try {
              if (firstEntry) {
                  // split archives have a special signature before the
                  // first local file header - look for it and fail with
                  // the appropriate error message if this is a split
                  // archive.
                  readFirstLocalFileHeader(lfhBuf);
              } else {
                  readFully(lfhBuf);
              }
          } catch (final EOFException e) {
              return null;
          }
  
          final ZipLong sig = new ZipLong(lfhBuf);
          if (!sig.equals(ZipLong.LFH_SIG)) {
              if (sig.equals(ZipLong.CFH_SIG) || sig.equals(ZipLong.AED_SIG) || isApkSigningBlock(lfhBuf)) {
                  hitCentralDirectory = true;
                  skipRemainderOfArchive();
                  return null;
              }
              throw new ZipException(String.format("Unexpected record signature: 0X%X", sig.getValue()));
          }
  
          int off = WORD;
          current = new CurrentEntry();
  
          final int versionMadeBy = ZipShort.getValue(lfhBuf, off);
          off += SHORT;
          current.entry.setPlatform((versionMadeBy >> ZipFile.BYTE_SHIFT) & ZipFile.NIBLET_MASK);
  
          final GeneralPurposeBit gpFlag = GeneralPurposeBit.parse(lfhBuf, off);
          final boolean hasUTF8Flag = gpFlag.usesUTF8ForNames();
          final ZipEncoding entryEncoding = hasUTF8Flag ? ZipEncodingHelper.UTF8_ZIP_ENCODING : zipEncoding;
          current.hasDataDescriptor = gpFlag.usesDataDescriptor();
          current.entry.setGeneralPurposeBit(gpFlag);
  
          off += SHORT;
  
          current.entry.setMethod(ZipShort.getValue(lfhBuf, off));
          off += SHORT;
  
          final long time = ZipUtil.dosToJavaTime(ZipLong.getValue(lfhBuf, off));
          current.entry.setTime(time);
          off += WORD;
  
          ZipLong size = null, cSize = null;
          if (!current.hasDataDescriptor) {
              current.entry.setCrc(ZipLong.getValue(lfhBuf, off));
              off += WORD;
  
              cSize = new ZipLong(lfhBuf, off);
              off += WORD;
  
              size = new ZipLong(lfhBuf, off);
              off += WORD;
          } else {
              off += 3 * WORD;
          }
  
          final int fileNameLen = ZipShort.getValue(lfhBuf, off);
  
          off += SHORT;
  
          final int extraLen = ZipShort.getValue(lfhBuf, off);
          off += SHORT; // NOSONAR - assignment as documentation
  
          final byte[] fileName = new byte[fileNameLen];
          readFully(fileName);
          current.entry.setName(entryEncoding.decode(fileName), fileName);
          if (hasUTF8Flag) {
              current.entry.setNameSource(ZipArchiveEntry.NameSource.NAME_WITH_EFS_FLAG);
          }
  
          final byte[] extraData = new byte[extraLen];
          readFully(extraData);
          current.entry.setExtra(extraData);
  
          if (!hasUTF8Flag && useUnicodeExtraFields) {
              ZipUtil.setNameAndCommentFromExtraFields(current.entry, fileName, null);
          }
  
          processZip64Extra(size, cSize);
  
          current.entry.setLocalHeaderOffset(currentHeaderOffset);
          current.entry.setDataOffset(getBytesRead());
          current.entry.setStreamContiguous(true);
  
          ZipMethod m = ZipMethod.getMethodByCode(current.entry.getMethod());
          if (current.entry.getCompressedSize() != ArchiveEntry.SIZE_UNKNOWN) {
              if (ZipUtil.canHandleEntryData(current.entry) && m != ZipMethod.STORED && m != ZipMethod.DEFLATED) {
                  InputStream bis = new BoundedInputStream(in, current.entry.getCompressedSize());
                  switch (m) {
                  case UNSHRINKING:
                      current.in = new UnshrinkingInputStream(bis);
                      break;
                  case IMPLODING:
                      current.in = new ExplodingInputStream(
                          current.entry.getGeneralPurposeBit().getSlidingDictionarySize(),
                          current.entry.getGeneralPurposeBit().getNumberOfShannonFanoTrees(),
                          bis);
                      break;
                  case BZIP2:
                      current.in = new BZip2CompressorInputStream(bis);
                      break;
                  case ENHANCED_DEFLATED:
                      current.in = new Deflate64CompressorInputStream(bis);
                      break;
                  default:
                      // we should never get here as all supported methods have been covered
                      // will cause an error when read is invoked, don't throw an exception here so people can
                      // skip unsupported entries
                      break;
                  }
              }
          } else if (m == ZipMethod.ENHANCED_DEFLATED) {
              current.in = new Deflate64CompressorInputStream(in);
          }
  
          entriesRead++;
          return current.entry;
      }
  
      /**
       * Fills the given array with the first local file header and
       * deals with splitting/spanning markers that may prefix the first
       * LFH.
       */
  