Package org.apache.tools.zip
Class UnrecognizedExtraField
java.lang.Object
org.apache.tools.zip.UnrecognizedExtraField
- All Implemented Interfaces:
- CentralDirectoryParsingZipExtraField,- ZipExtraField
Simple placeholder for all those extra fields we don't want to deal
 with.
 
Assumes local file data and central directory entries are identical - unless told the opposite.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbyte[]Get the central data.Get the central data length.Get the header id.byte[]Get the local data.Get the length of the local data.voidparseFromCentralDirectoryData(byte[] data, int offset, int length) Populate data from this array as if it was in central directory data.voidparseFromLocalFileData(byte[] data, int offset, int length) Populate data from this array as if it was in local file data.voidsetCentralDirectoryData(byte[] data) Set the extra field data in central directory.voidsetHeaderId(ZipShort headerId) Set the header id.voidsetLocalFileDataData(byte[] data) Set the extra field data in the local file data - without Header-ID or length specifier.
- 
Constructor Details- 
UnrecognizedExtraFieldpublic UnrecognizedExtraField()
 
- 
- 
Method Details- 
setHeaderIdSet the header id.- Parameters:
- headerId- the header id to use
 
- 
getHeaderIdGet the header id.- Specified by:
- getHeaderIdin interface- ZipExtraField
- Returns:
- the header id
 
- 
setLocalFileDataDatapublic void setLocalFileDataData(byte[] data) Set the extra field data in the local file data - without Header-ID or length specifier.- Parameters:
- data- the field data to use
 
- 
getLocalFileDataLengthGet the length of the local data.- Specified by:
- getLocalFileDataLengthin interface- ZipExtraField
- Returns:
- the length of the local data
 
- 
getLocalFileDataDatapublic byte[] getLocalFileDataData()Get the local data.- Specified by:
- getLocalFileDataDatain interface- ZipExtraField
- Returns:
- the local data
 
- 
setCentralDirectoryDatapublic void setCentralDirectoryData(byte[] data) Set the extra field data in central directory.- Parameters:
- data- the data to use
 
- 
getCentralDirectoryLengthGet the central data length. If there is no central data, get the local file data length.- Specified by:
- getCentralDirectoryLengthin interface- ZipExtraField
- Returns:
- the central data length
 
- 
getCentralDirectoryDatapublic byte[] getCentralDirectoryData()Get the central data.- Specified by:
- getCentralDirectoryDatain interface- ZipExtraField
- Returns:
- the central data if present, else return the local file data
 
- 
parseFromLocalFileDatapublic void parseFromLocalFileData(byte[] data, int offset, int length) Description copied from interface:ZipExtraFieldPopulate data from this array as if it was in local file data.- Specified by:
- parseFromLocalFileDatain interface- ZipExtraField
- Parameters:
- data- the array of bytes.
- offset- the source location in the data array.
- length- the number of bytes to use in the data array.
- See Also:
 
- 
parseFromCentralDirectoryDatapublic void parseFromCentralDirectoryData(byte[] data, int offset, int length) Description copied from interface:CentralDirectoryParsingZipExtraFieldPopulate data from this array as if it was in central directory data.- Specified by:
- parseFromCentralDirectoryDatain interface- CentralDirectoryParsingZipExtraField
- Parameters:
- data- the array of bytes.
- offset- the source location in the data array.
- length- the number of bytes to use in the data array.
 
 
-