/** number of entries in file (files AND directories) */ public short getNumberOfEntries() throws IOException { return raFile.readShort( this.dirOffsetPos-6 ); }
/** number of entries in file (files AND directories) */ public short getNumberOfEntries() throws IOException { return raFile.readShort( this.dirOffsetPos-6 ); }
public short readShort(long pos) throws IOException { file.seek(pos); return readShort(); }
public short readShort(long pos) throws IOException { file.seek(pos); return readShort(); }
short flag = raFile.readShort( fileOffset + 8 ); this.isEncrypted = (flag&1)>0; this.fileNameLength = raFile.readShort( fileOffset + 28 ); byte[] fileNameBytes = raFile.readByteArray( fileOffset + 46, fileNameLength ); this.fileName = new String( fileNameBytes, AesZipFileDecrypter.charset ); this.extraFieldLength = raFile.readShort( fileOffset + 30 ); this.localHeaderOffset = raFile.readInt( fileOffset + 28 + 14 ); if( efhid[0]!=0x01 || efhid[1]!=(byte)0x99 ) { this.extraFieldOffset = localHeaderOffset+30+fileNameLength; this.extraFieldLength = raFile.readShort( localHeaderOffset+28 ); if( LOG.isLoggable(Level.FINE) ) { LOG.fine( "local header - extraFieldOffset=" + Long.toHexString(this.extraFieldOffset) ); this.actualCompressionMethod = raFile.readShort( getExtraFieldOffset() + 9 ); this.localHeaderSize = 30 + getExtraFieldLength() + getFileNameLength();
short flag = raFile.readShort( fileOffset + 8 ); this.isEncrypted = (flag&1)>0; this.fileNameLength = raFile.readShort( fileOffset + 28 ); byte[] fileNameBytes = raFile.readByteArray( fileOffset + 46, fileNameLength ); this.fileName = new String( fileNameBytes, AesZipFileDecrypter.charset ); this.extraFieldLength = raFile.readShort( fileOffset + 30 ); this.localHeaderOffset = raFile.readInt( fileOffset + 28 + 14 ); if( efhid[0]!=0x01 || efhid[1]!=(byte)0x99 ) { this.extraFieldOffset = localHeaderOffset+30+fileNameLength; this.extraFieldLength = raFile.readShort( localHeaderOffset+28 ); if( LOG.isLoggable(Level.FINE) ) { LOG.fine( "local header - extraFieldOffset=" + Long.toHexString(this.extraFieldOffset) ); this.actualCompressionMethod = raFile.readShort( getExtraFieldOffset() + 9 ); this.localHeaderSize = 30 + getExtraFieldLength() + getFileNameLength();
protected void initDirOffsetPosAndComment() throws IOException { // zip files without a comment contain the offset/position of the central directory at this fixed position this.dirOffsetPos = zipFile.length() - 6; final int dirOffset = raFile.readInt( this.dirOffsetPos - 16 ); if( dirOffset!=ENDSIG ) { // if a comment is present, search the ENDSIG constant, starting at the end of the zip file byte[] endsig = ByteArrayHelper.toByteArray((int)ZipConstants.ENDSIG); long endsigPos = raFile.lastPosOf(endsig); if( endsigPos==-1 ) { throw new ZipException("expected ENDSIC not found (marks the beginning of the central directory at end of the zip file)"); } else { this.dirOffsetPos = endsigPos+16; short commentLength = raFile.readShort( this.dirOffsetPos + 4 ); this.comment = new String( raFile.readByteArray( this.dirOffsetPos+6, commentLength ) ); } } }
protected void initDirOffsetPosAndComment() throws IOException { // zip files without a comment contain the offset/position of the central directory at this fixed position this.dirOffsetPos = zipFile.length() - 6; final int dirOffset = raFile.readInt( this.dirOffsetPos - 16 ); if( dirOffset!=ENDSIG ) { // if a comment is present, search the ENDSIG constant, starting at the end of the zip file byte[] endsig = ByteArrayHelper.toByteArray((int)ZipConstants.ENDSIG); long endsigPos = raFile.lastPosOf(endsig); if( endsigPos==-1 ) { throw new ZipException("expected ENDSIC not found (marks the beginning of the central directory at end of the zip file)"); } else { this.dirOffsetPos = endsigPos+16; short commentLength = raFile.readShort( this.dirOffsetPos + 4 ); this.comment = new String( raFile.readByteArray( this.dirOffsetPos+6, commentLength ) ); } } }