private boolean bufferNextCentralFileHeader ( ) throws IOException { buffer . reset ( ) ; if ( currentCentralEntryIdx == processedEntries . size ( ) ) { return false ; } ProcessedEntry entry = processedEntries . get ( currentCentralEntryIdx ++ ) ; JarEntry jarEntry = entry . jarEntry ; bufferInt ( ZipEntry . CENSIG ) ; // Central file header signature bufferShort ( 10 ) ; // Version made by bufferShort ( 10 ) ; // Extraction version bufferShort ( 0 ) ; // Flags bufferShort ( ZipEntry . STORED ) ; // Compression type bufferInt ( jarEntry . getTime ( ) ) ; // Entry time bufferInt ( entry . crc ) ; // CRC bufferInt ( jarEntry . getSize ( ) ) ; // Compressed size bufferInt ( jarEntry . getSize ( ) ) ; // Uncompressed size byte [ ] nameBytes = jarEntry . getName ( ) . getBytes ( "UTF8" ) ; bufferShort ( nameBytes . length ) ; // Entry name length bufferShort ( 0 ) ; // Extra field length bufferShort ( 0 ) ; // File comment length bufferShort ( 0 ) ; // Disk number start bufferShort ( 0 ) ; // Internal file attributes bufferInt ( 0 ) ; // External file attributes bufferInt ( entry . offset ) ; // Relative offset of local header buffer ( nameBytes ) ; return true ; }
Buffer the central file header record for a single entry .