Package org.apache.tools.zip
Class UnparseableExtraFieldData
- java.lang.Object
-
- org.apache.tools.zip.UnparseableExtraFieldData
-
- All Implemented Interfaces:
CentralDirectoryParsingZipExtraField,ZipExtraField
public final class UnparseableExtraFieldData extends java.lang.Object implements CentralDirectoryParsingZipExtraField
Wrapper for extra field data that doesn't conform to the recommended format of header-tag + size + data.The header-id is artificial (and not listed as a known ID in APPNOTE.TXT). Since it isn't used anywhere except to satisfy the ZipExtraField contract it shouldn't matter anyway.
- Since:
- Ant 1.8.1
-
-
Constructor Summary
Constructors Constructor Description UnparseableExtraFieldData()
-
Method Summary
Modifier and Type Method Description byte[]getCentralDirectoryData()The actual data to put into central directory.ZipShortgetCentralDirectoryLength()Length of the complete extra field in the central directory.ZipShortgetHeaderId()The Header-ID.byte[]getLocalFileDataData()The actual data to put into local file data.ZipShortgetLocalFileDataLength()Length of the complete extra field in the local file data.voidparseFromCentralDirectoryData(byte[] buffer, int offset, int length)Populate data from this array as if it was in central directory data.voidparseFromLocalFileData(byte[] buffer, int offset, int length)Populate data from this array as if it was in local file data.
-
-
-
Method Detail
-
getHeaderId
public ZipShort getHeaderId()
The Header-ID.- Specified by:
getHeaderIdin interfaceZipExtraField- Returns:
- a completely arbitrary value that should be ignored.
-
getLocalFileDataLength
public ZipShort getLocalFileDataLength()
Length of the complete extra field in the local file data.- Specified by:
getLocalFileDataLengthin interfaceZipExtraField- Returns:
- The LocalFileDataLength value
-
getCentralDirectoryLength
public ZipShort getCentralDirectoryLength()
Length of the complete extra field in the central directory.- Specified by:
getCentralDirectoryLengthin interfaceZipExtraField- Returns:
- The CentralDirectoryLength value
-
getLocalFileDataData
public byte[] getLocalFileDataData()
The actual data to put into local file data.- Specified by:
getLocalFileDataDatain interfaceZipExtraField- Returns:
- The LocalFileDataData value
-
getCentralDirectoryData
public byte[] getCentralDirectoryData()
The actual data to put into central directory.- Specified by:
getCentralDirectoryDatain interfaceZipExtraField- Returns:
- The CentralDirectoryData value
-
parseFromLocalFileData
public void parseFromLocalFileData(byte[] buffer, int offset, int length)Populate data from this array as if it was in local file data.- Specified by:
parseFromLocalFileDatain interfaceZipExtraField- Parameters:
buffer- the buffer to read data fromoffset- offset into buffer to read datalength- the length of data
-
parseFromCentralDirectoryData
public void parseFromCentralDirectoryData(byte[] buffer, int offset, int length)Populate data from this array as if it was in central directory data.- Specified by:
parseFromCentralDirectoryDatain interfaceCentralDirectoryParsingZipExtraField- Parameters:
buffer- the buffer to read data fromoffset- offset into buffer to read datalength- the length of data
-
-