Top Description Methods
org.apache.tools.zip

public Interface ZipExtraField

Known Direct Subinterfaces
org.apache.tools.zip.CentralDirectoryParsingZipExtraField
Known Direct Implementers
org.apache.tools.zip.AbstractUnicodeExtraField, org.apache.tools.zip.AsiExtraField, org.apache.tools.zip.JarMarker
Imports
java.util.zip.ZipException

General format of extra field data.

Extra fields usually appear twice per file, once in the local file data and once in the central directory. Usually they are the same, but they don't have to be. java.util.zip.ZipOutputStream will only use the local file data in both places.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the data
getCentralDirectoryData
()

The actual data to put into central directory - without Header-ID or length specifier.

public ZipShort

Returns:

the length of the field in the central directory
getCentralDirectoryLength
()

Length of the extra field in the central directory - without Header-ID or length specifier.

public ZipShort

Returns:

the header id
getHeaderId
()

The Header-ID.

public byte[]

Returns:

the data
getLocalFileDataData
()

The actual data to put into local file data - without Header-ID or length specifier.

public ZipShort

Returns:

the length of the field in the local file data
getLocalFileDataLength
()

Length of the extra field in the local file data - without Header-ID or length specifier.

public void
parseFromLocalFileData(byte[]
an array of bytes
data
,
int
the start offset
offset
,
int
the number of bytes in the array from offset
length
)

Populate data from this array as if it was in local file data.

Method Detail

getCentralDirectoryDataback to summary
public byte[] getCentralDirectoryData()

The actual data to put into central directory - without Header-ID or length specifier.

Returns:byte[]

the data

Since
1.1
getCentralDirectoryLengthback to summary
public ZipShort getCentralDirectoryLength()

Length of the extra field in the central directory - without Header-ID or length specifier.

Returns:ZipShort

the length of the field in the central directory

Since
1.1
getHeaderIdback to summary
public ZipShort getHeaderId()

The Header-ID.

Returns:ZipShort

the header id

Since
1.1
getLocalFileDataDataback to summary
public byte[] getLocalFileDataData()

The actual data to put into local file data - without Header-ID or length specifier.

Returns:byte[]

the data

Since
1.1
getLocalFileDataLengthback to summary
public ZipShort getLocalFileDataLength()

Length of the extra field in the local file data - without Header-ID or length specifier.

Returns:ZipShort

the length of the field in the local file data

Since
1.1
parseFromLocalFileDataback to summary
public void parseFromLocalFileData(byte[] data, int offset, int length) throws ZipException

Populate data from this array as if it was in local file data.

Parameters
data:byte[]

an array of bytes

offset:int

the start offset

length:int

the number of bytes in the array from offset

Exceptions
ZipException:
on error
Since
1.1