org.apache.tools.zip

Class UnrecognizedExtraField

public class UnrecognizedExtraField extends Object implements CentralDirectoryParsingZipExtraField

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.

Method Summary
byte[]getCentralDirectoryData()
Get the central data.
ZipShortgetCentralDirectoryLength()
Get the central data length.
ZipShortgetHeaderId()
Get the header id.
byte[]getLocalFileDataData()
Get the local data.
ZipShortgetLocalFileDataLength()
Get the length of the local data.
voidparseFromCentralDirectoryData(byte[] data, int offset, int length)
voidparseFromLocalFileData(byte[] data, int offset, int length)
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.

Method Detail

getCentralDirectoryData

public byte[] getCentralDirectoryData()
Get the central data.

Returns: the central data if present, else return the local file data

getCentralDirectoryLength

public ZipShort getCentralDirectoryLength()
Get the central data length. If there is no central data, get the local file data length.

Returns: the central data length

getHeaderId

public ZipShort getHeaderId()
Get the header id.

Returns: the header id

getLocalFileDataData

public byte[] getLocalFileDataData()
Get the local data.

Returns: the local data

getLocalFileDataLength

public ZipShort getLocalFileDataLength()
Get the length of the local data.

Returns: the length of the local data

parseFromCentralDirectoryData

public void parseFromCentralDirectoryData(byte[] data, int offset, int length)

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.

parseFromLocalFileData

public void parseFromLocalFileData(byte[] data, int offset, int length)

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: (byte[], int, int)

setCentralDirectoryData

public void setCentralDirectoryData(byte[] data)
Set the extra field data in central directory.

Parameters: data the data to use

setHeaderId

public void setHeaderId(ZipShort headerId)
Set the header id.

Parameters: headerId the header id to use

setLocalFileDataData

public 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