org.apache.tools.zip

Class UnparseableExtraFieldData

public final class UnparseableExtraFieldData extends 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 know ID in the .ZIP File Format Specification). Since it isn't used anywhere except to satisfy the ZipExtraField contract it shouldn't matter anyway.

Since: Ant 1.8.1

See Also: .ZIP File Format Specification

Method Summary
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

getCentralDirectoryData

public byte[] getCentralDirectoryData()
The actual data to put into central directory.

Returns: The CentralDirectoryData value

getCentralDirectoryLength

public ZipShort getCentralDirectoryLength()
Length of the complete extra field in the central directory.

Returns: The CentralDirectoryLength value

getHeaderId

public ZipShort getHeaderId()
The Header-ID.

Returns: a completely arbitrary value that should be ignored.

getLocalFileDataData

public byte[] getLocalFileDataData()
The actual data to put into local file data.

Returns: The LocalFileDataData value

getLocalFileDataLength

public ZipShort getLocalFileDataLength()
Length of the complete extra field in the local file data.

Returns: The LocalFileDataLength value

parseFromCentralDirectoryData

public void parseFromCentralDirectoryData(byte[] buffer, int offset, int length)
Populate data from this array as if it was in central directory data.

Parameters: buffer the buffer to read data from offset offset into buffer to read data length the length of data

Throws: ZipException on error

parseFromLocalFileData

public void parseFromLocalFileData(byte[] buffer, int offset, int length)
Populate data from this array as if it was in local file data.

Parameters: buffer the buffer to read data from offset offset into buffer to read data length the length of data