Code example for ZipEntry

Methods: getCompressedSizegetMethod

0
		if( !Arrays.equals(intBuffer, new byte[] { 0x50, 0x4b, 0x03, 0x04 }) ) {
			throw new IOException("wrong local file header signature - value=" + ByteArrayHelper.toString(intBuffer) );
		} 
 
		// info only - if bit-3 is set, current entry is followed by data descriptor 
		boolean hasDataDescriptor = (ze.getMethod() & 8) > 0;
		LOG.fine( "nextEntry().hasDataDescriptor=" + hasDataDescriptor );
 
		this.compressedSize = ze.getCompressedSize();
		 
		fis.skip(14 + 4 + 4); // 14 + localFileHeaderSignature(4) + compressedSize(4) + size(4)
 
		byte[] shortBuffer = new byte[2];
		fis.read(shortBuffer);
		int fileNameLength = ByteArrayHelper.toInt(shortBuffer);
 
		fis.read(shortBuffer);
		int extraFieldLength = ByteArrayHelper.toInt(shortBuffer);
 
		startPos = 18 + 12 + fileNameLength + extraFieldLength + dataDescriptorLength;