public class Zip64 extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
MAX_ZIP_ENTRY_AND_ARCHIVE_SIZE
The maximum supported entry / archive size for standard (non zip64) entries and archives.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
insertZip64ExtendedInfoToExtras(ZipEntry ze)
Appends a zip64 extended info record to the extras contained in
ze. |
static java.util.zip.ZipFile.EocdRecord |
parseZip64EocdRecord(RandomAccessFile raf,
long eocdRecordOffset,
int commentLength) |
static long |
parseZip64EocdRecordLocator(RandomAccessFile raf,
long eocdOffset)
Parses the zip64 end of central directory record locator.
|
static boolean |
parseZip64ExtendedInfo(ZipEntry ze,
boolean fromCentralDirectory)
Parse the zip64 extended info record from the extras present in
ze. |
static void |
refreshZip64ExtendedInfo(ZipEntry ze)
Copy the size, compressed size and local header offset fields from
ze to
inside ze's extended info record. |
static void |
writeZip64EocdRecordAndLocator(ByteArrayOutputStream baos,
long numEntries,
long offset,
long cDirSize) |
public static final long MAX_ZIP_ENTRY_AND_ARCHIVE_SIZE
public static long parseZip64EocdRecordLocator(RandomAccessFile raf, long eocdOffset) throws IOException
eocdOffset.
The position of the file cursor for raf after a call to this method
is undefined an callers must reposition it after each call to this method.IOExceptionpublic static java.util.zip.ZipFile.EocdRecord parseZip64EocdRecord(RandomAccessFile raf, long eocdRecordOffset, int commentLength) throws IOException
IOExceptionpublic static boolean parseZip64ExtendedInfo(ZipEntry ze, boolean fromCentralDirectory) throws ZipException
ze.
If fromCentralDirectory is true, we assume we're parsing a central directory
record. We assume a local file header otherwise. The difference between the two is that
a central directory entry is required to be complete, whereas a local file header isn't.
This is due to the presence of an optional data descriptor after the file content.ZipExceptionpublic static void insertZip64ExtendedInfoToExtras(ZipEntry ze) throws ZipException
ze. If ze
contains no extras, a new extras array is created.ZipExceptionpublic static void refreshZip64ExtendedInfo(ZipEntry ze)
ze to
inside ze's extended info record. This is additional step is necessary when
we could calculate the correct sizes only after writing out the entry. In this case,
the local file header would not contain real sizes, and they would be present in the
data descriptor and the central directory only.
We choose the simplest strategy of always writing out the size, compressedSize and
local header offset in all our Zip64 Extended info records.public static void writeZip64EocdRecordAndLocator(ByteArrayOutputStream baos, long numEntries, long offset, long cDirSize) throws IOException
IOException