Buggy code:
private boolean hasUsedZip64 = false ; private Zip64Mode zip64Mode = Zip64Mode . AsNeeded ; public ZipArchiveOutputStream ( OutputStream out ) { } public ZipArchiveOutputStream ( File file ) throws IOException { } public boolean isSeekable ( ) { } public void setEncoding ( final String encoding ) { } public String getEncoding ( ) { } public void setUseLanguageEncodingFlag ( boolean b ) { } public void setCreateUnicodeExtraFields ( ZipArchiveOutputStream . UnicodeExtraFieldPolicy b ) { } public void setFallbackToUTF8 ( boolean b ) { } public void setUseZip64 ( Zip64Mode mode ) { } @ Override public void finish ( ) throws IOException { } private void writeCentralDirectoryInChunks ( ) throws IOException { } @ Override public void closeArchiveEntry ( ) throws IOException { } private void closeCopiedEntry ( boolean phased ) throws IOException { } private void closeEntry ( boolean actuallyNeedsZip64 , boolean phased ) throws IOException { } private void preClose ( ) throws IOException { } public void addRawArchiveEntry ( ZipArchiveEntry entry , InputStream rawStream ) throws IOException { } private void flushDeflater ( ) throws IOException { } private boolean handleSizesAndCrc ( long bytesWritten , long crc , Zip64Mode effectiveMode ) throws ZipException { } private boolean checkIfNeedsZip64 ( Zip64Mode effectiveMode ) throws ZipException { } private boolean isZip64Required ( ZipArchiveEntry entry1 , Zip64Mode requestedMode ) { } private boolean isTooLageForZip32 ( ZipArchiveEntry zipArchiveEntry ) { } private void rewriteSizesAndCrc ( boolean actuallyNeedsZip64 ) throws IOException { } @ Override public void putArchiveEntry ( ArchiveEntry archiveEntry ) throws IOException { } private void putArchiveEntry ( ArchiveEntry archiveEntry , boolean phased ) throws IOException { } private void setDefaults ( ZipArchiveEntry entry ) { } private void validateSizeInformation ( Zip64Mode effectiveMode ) throws ZipException { } private boolean shouldAddZip64Extra ( ZipArchiveEntry entry , Zip64Mode mode ) { } public void setComment ( String comment ) { } public void setLevel ( int level ) { } public void setMethod ( int method ) { } @ Override public boolean canWriteEntryData ( ArchiveEntry ae ) { } @ Override public void write ( byte [ ] b , int offset , int length ) throws IOException { } private void writeCounted ( byte [ ] data ) throws IOException { } final byte [ ] copyBuffer = new byte [ 32768 ] ; private void copyFromZipInputStream ( InputStream src ) throws IOException { } @ Override public void close ( ) throws IOException { } @ Override public void flush ( ) throws IOException { } static final byte [ ] LFH_SIG = ZipLong . LFH_SIG . getBytes ( ) ; static final byte [ ] DD_SIG = ZipLong . DD_SIG . getBytes ( ) ; static final byte [ ] CFH_SIG = ZipLong . CFH_SIG . getBytes ( ) ; static final byte [ ] EOCD_SIG = ZipLong . getBytes ( 101010256L ) ; static final byte [ ] ZIP64_EOCD_SIG = ZipLong . getBytes ( 101075792L ) ; static final byte [ ] ZIP64_EOCD_LOC_SIG = ZipLong . getBytes ( 117853008L ) ; protected final void deflate ( ) throws IOException { } protected void writeLocalFileHeader ( ZipArchiveEntry ze ) throws IOException { } private void writeLocalFileHeader ( ZipArchiveEntry ze , boolean phased ) throws IOException { } private byte [ ] createLocalFileHeader ( ZipArchiveEntry ze , ByteBuffer name , boolean encodable , boolean phased ) { } private void addUnicodeExtraFields ( ZipArchiveEntry ze , boolean encodable , ByteBuffer name ) throws IOException { } protected void writeDataDescriptor ( ZipArchiveEntry ze ) throws IOException { } protected void writeCentralFileHeader ( ZipArchiveEntry ze ) throws IOException { } private byte [ ] createCentralFileHeader ( ZipArchiveEntry ze ) throws IOException { <START_BUG> final long lfhOffset = offsets . get ( ze ) . longValue ( ) ; <END_BUG> final boolean needsZip64Extra = ( ( ( hasZip64Extra ( ze ) ) || ( ( ze . getCompressedSize ( ) ) >= ( ZipConstants . ZIP64_MAGIC ) ) ) || ( ( ze . getSize ( ) ) >= ( ZipConstants . ZIP64_MAGIC ) ) ) || ( lfhOffset >= ( ZipConstants . ZIP64_MAGIC ) ) ; if ( needsZip64Extra && ( ( zip64Mode ) == ( Zip64Mode . Never ) ) ) { throw new Zip64RequiredException ( Zip64RequiredException . ARCHIVE_TOO_BIG_MESSAGE ) ; } handleZip64Extra ( ze , lfhOffset , needsZip64Extra ) ; return createCentralFileHeader ( ze , getName ( ze ) , lfhOffset , needsZip64Extra ) ; } private final Calendar calendarInstance = Calendar . getInstance ( ) ; private byte [ ] createCentralFileHeader ( ZipArchiveEntry ze , ByteBuffer name , long lfhOffset , boolean needsZip64Extra ) throws IOException { } private void handleZip64Extra ( ZipArchiveEntry ze , long lfhOffset , boolean needsZip64Extra ) { } protected void writeCentralDirectoryEnd ( ) throws IOException { } private static final byte [ ] ONE = ZipLong . getBytes ( 1L ) ; protected void writeZip64CentralDirectory ( ) throws IOException { } protected final void writeOut ( byte [ ] data ) throws IOException { } protected final void writeOut ( byte [ ] data , int offset , int length ) throws IOException { } private GeneralPurposeBit getGeneralPurposeBits ( final int zipMethod , final boolean utfFallback ) { } private int versionNeededToExtract ( final int zipMethod , final boolean zip64 ) { } private boolean isDeflatedToOutputStream ( int zipMethod ) { } @ Override public ArchiveEntry createArchiveEntry ( File inputFile , String entryName ) throws IOException { } private Zip64ExtendedInformationExtraField getZip64Extra ( ZipArchiveEntry ze ) { } private boolean hasZip64Extra ( ZipArchiveEntry ze ) { } private Zip64Mode getEffectiveZip64Mode ( ZipArchiveEntry ze ) { } private ZipEncoding getEntryEncoding ( ZipArchiveEntry ze ) { } private ByteBuffer getName ( ZipArchiveEntry ze ) throws IOException { } void destroy ( ) throws IOException { } public static final class UnicodeExtraFieldPolicy { public static final ZipArchiveOutputStream . UnicodeExtraFieldPolicy ALWAYS = new ZipArchiveOutputStream . UnicodeExtraFieldPolicy ( "always" ) ; public static final ZipArchiveOutputStream . UnicodeExtraFieldPolicy NEVER = new ZipArchiveOutputStream . UnicodeExtraFieldPolicy ( "never" ) ;

Fix:
final long lfhOffset = offsets . get ( ze ) ;