public int readInt(long pos) throws IOException { file.seek(pos); return readInt(); }
public int readInt(long pos) throws IOException { file.seek(pos); return readInt(); }
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 ) ); } } }
final int dirOffset = raFile.readInt( this.dirOffsetPos ); int censig = raFile.readInt( fileOffset ); if( censig!=CENSIG ) { throw new ZipException("expected CENSIC not found at entry no " + (i+1) + " in central directory at end of zip file at " + fileOffset); short extraFieldLength = raFile.readShort( fileOffset + 30 ); long fileOffsetPos = fileOffset + 28 + 14; long fileDataOffset = raFile.readInt( fileOffsetPos ); int locsig = raFile.readInt( fileDataOffset ); if( locsig!=LOCSIG ) { throw new ZipException("expected LOCSIC not found at alleged position of data for file no " + (i+1)); zipEntry.setSize( cde.getUncompressedSize() ); long dosTime = raFile.readInt( fileOffset + 12 ); zipEntry.setTime( ExtZipEntry.dosToJavaTime(dosTime) );
final int dirOffset = raFile.readInt( this.dirOffsetPos ); int censig = raFile.readInt( fileOffset ); if( censig!=CENSIG ) { throw new ZipException("expected CENSIC not found at entry no " + (i+1) + " in central directory at end of zip file at " + fileOffset); short extraFieldLength = raFile.readShort( fileOffset + 30 ); long fileOffsetPos = fileOffset + 28 + 14; long fileDataOffset = raFile.readInt( fileOffsetPos ); int locsig = raFile.readInt( fileDataOffset ); if( locsig!=LOCSIG ) { throw new ZipException("expected LOCSIC not found at alleged position of data for file no " + (i+1)); zipEntry.setSize( cde.getUncompressedSize() ); long dosTime = raFile.readInt( fileOffset + 12 ); zipEntry.setTime( ExtZipEntry.dosToJavaTime(dosTime) );