From: Hans G. F. <HG...@t-...> - 2006-06-07 14:28:03
|
Hi, I've to process a lot of zip files within my java routines. But very often the java.util.zip-Routines can not extract the files because of they do not provide the general format of a .zip file chapter K(http://www.pkware.com/business_and_developers/developer/appnote/), Splitting and Spanning ZIP files. The last paragraph says: A special spanning marker may also appear in spanned/split archives if the spanning or splitting process starts but only requires one segment. In this case the 0x08074b50 signature will be replaced with the temporary spanning marker signature of 0x30304b50. Spanned/split archives created with this special signature are compatible with all versions of PKZIP from PKWARE. Split archives can only be uncompressed by other versions of PKZIP that know how to create a split archive. This signature (0x30304b50) causes the trouble. I saw that jazzlib does not support this feature too. But it would be very easy to provide this by simply controlling and ignoring this first four bytes and go on with the next four bytes: ...... if (header == CENSIG) { /* Central Header reached. */ close(); return null; } * if( header == 'P'|('K'<<8)|('0'<<16)|('0'<<24)) { header = readLeInt(); } * if (header != LOCSIG) throw new ZipException("Wrong Local header signature: " + Integer.toHexString(header)); /* skip version */ ........ I would appreciate this litle changes. Thanks Hans Georg |