public class Zip64ExtendedInformationExtraField extends Objectimplements ZipExtraField
Currently Commons Compress doesn't support encrypting the central directory so the note in APPNOTE.TXT about masking doesn't apply.
The implementation relies on data being read from the local file header and assumes that both size values are always present.
| Constructor and Description |
|---|
Zip64ExtendedInformationExtraField()
This constructor should only be used by the code that reads archives inside of Commons Compress.
|
Zip64ExtendedInformationExtraField(ZipEightByteInteger
Creates an extra field based on the original and compressed size.
|
Zip64ExtendedInformationExtraField(ZipEightByteInteger
Creates an extra field based on all four possible values.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getCentralDirectoryData()
The actual data to put into central directory - without Header-ID or length specifier.
|
ZipShort |
getCentralDirectoryLength()
Length of the extra field in the central directory - without Header-ID or length specifier.
|
ZipEightByteInteger |
getCompressedSize()
The compressed size stored in this extra field.
|
ZipLong |
getDiskStartNumber()
The disk start number stored in this extra field.
|
ZipShort |
getHeaderId()
The Header-ID.
|
byte[] |
getLocalFileDataData()
The actual data to put into local file data - without Header-ID or length specifier.
|
ZipShort |
getLocalFileDataLength()
Length of the extra field in the local file data - without Header-ID or length specifier.
|
ZipEightByteInteger |
getRelativeHeaderOffset()
The relative header offset stored in this extra field.
|
ZipEightByteInteger |
getSize()
The uncompressed size stored in this extra field.
|
void |
parseFromCentralDirectoryData(byte[] buffer, int offset, int length)
Populate data from this array as if it was in central directory data.
|
void |
parseFromLocalFileData(byte[] buffer, int offset, int length)
Populate data from this array as if it was in local file data.
|
void |
reparseCentralDirectoryData(boolean hasUncompressedSize, boolean hasCompressedSize, boolean hasRelativeHeaderOffset, boolean hasDiskStart)
Parses the raw bytes read from the central directory extra field with knowledge which fields are expected to be there.
|
void |
setCompressedSize(ZipEightByteInteger
The uncompressed size stored in this extra field.
|
void |
setDiskStartNumber(ZipLong
The disk start number stored in this extra field.
|
void |
setRelativeHeaderOffset(ZipEightByteInteger
The relative header offset stored in this extra field.
|
void |
setSize(ZipEightByteInteger
The uncompressed size stored in this extra field.
|
public Zip64ExtendedInformationExtraField()
public Zip64ExtendedInformationExtraField(ZipEightByteIntegersize, ZipEightByteInteger compressedSize)
size - the entry's original size
compressedSize - the entry's compressed size
IllegalArgumentException - if size or compressedSize is null
public Zip64ExtendedInformationExtraField(ZipEightByteIntegersize, ZipEightByteInteger compressedSize, ZipEightByteInteger relativeHeaderOffset, ZipLong diskStart)
size - the entry's original size
compressedSize - the entry's compressed size
IllegalArgumentException - if size or compressedSize is null
public ZipShortgetHeaderId()
ZipExtraField
getHeaderId in interface
ZipExtraField
public ZipShortgetLocalFileDataLength()
ZipExtraField
getLocalFileDataLength in interface
ZipExtraField
public ZipShortgetCentralDirectoryLength()
ZipExtraField
getCentralDirectoryLength in interface
ZipExtraField
public byte[] getLocalFileDataData()
ZipExtraField
getLocalFileDataData in interface
ZipExtraField
public byte[] getCentralDirectoryData()
ZipExtraField
getCentralDirectoryData in interface
ZipExtraField
public void parseFromLocalFileData(byte[] buffer,
int offset,
int length)
throws ZipException
ZipExtraField
parseFromLocalFileData in interface
ZipExtraField
buffer - the buffer to read data from
offset - offset into buffer to read data
length - the length of data
ZipException - on error
public void parseFromCentralDirectoryData(byte[] buffer,
int offset,
int length)
throws ZipException
ZipExtraField
parseFromCentralDirectoryData in interface
ZipExtraField
buffer - the buffer to read data from
offset - offset into buffer to read data
length - the length of data
ZipException - on error
public void reparseCentralDirectoryData(boolean hasUncompressedSize,
boolean hasCompressedSize,
boolean hasRelativeHeaderOffset,
boolean hasDiskStart)
throws ZipException
All four fields inside the zip64 extended information extra field are optional and must only be present if their corresponding entry inside the central directory contains the correct magic value.
ZipException
public ZipEightByteIntegergetSize()
public void setSize(ZipEightByteIntegersize)
public ZipEightByteIntegergetCompressedSize()
public void setCompressedSize(ZipEightByteIntegercompressedSize)
public ZipEightByteIntegergetRelativeHeaderOffset()
public void setRelativeHeaderOffset(ZipEightByteIntegerrho)
public ZipLonggetDiskStartNumber()
public void setDiskStartNumber(ZipLongds)