Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.zip

public Class UnrecognizedExtraField

extends Object
implements ZipExtraField
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.archivers.zip.ZipExtraField
Imports
java.util.Arrays

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.

Field Summary

Modifier and TypeField and Description
private byte[]
centralData

Extra field data in central directory - without Header-ID or length specifier.

private ZipShort
headerId

The Header-ID.

private byte[]
localData

Extra field data in local file data - without Header-ID or length specifier.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the central data if present, else return the local file data
getCentralDirectoryData
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryData.

Gets the central data.
public ZipShort

Returns:

the central data length
getCentralDirectoryLength
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryLength.

Gets the central data length.
public ZipShort

Returns:

the header id
getHeaderId
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getHeaderId.

Gets the header id.
public byte[]
public ZipShort

Returns:

the length of the local data
getLocalFileDataLength
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataLength.

Gets the length of the local data.
public void
parseFromCentralDirectoryData(final byte[]
the array of bytes.
data
,
final int
the source location in the data array.
offset
,
final int
the number of bytes to use in the data array.
length
)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Populate data from this array as if it was in central directory data.
public void
parseFromLocalFileData(final byte[]
the array of bytes.
data
,
final int
the source location in the data array.
offset
,
final int
the number of bytes to use in the data array.
length
)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

Populate data from this array as if it was in local file data.
public void
setCentralDirectoryData(final byte[]
the data to use
data
)

Sets the extra field data in central directory.

public void
setHeaderId(final ZipShort
the header id to use
headerId
)

Sets the header id.

public void
setLocalFileDataData(final byte[]
the field data to use
data
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

centralDataback to summary
private byte[] centralData

Extra field data in central directory - without Header-ID or length specifier.

headerIdback to summary
private ZipShort headerId

The Header-ID.

localDataback to summary
private byte[] localData

Extra field data in local file data - without Header-ID or length specifier.

Constructor Detail

UnrecognizedExtraFieldback to summary
public UnrecognizedExtraField()

Method Detail

getCentralDirectoryDataback to summary
public byte[] getCentralDirectoryData()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryData.

Gets the central data.

Returns:byte[]

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

Annotations
@Override
getCentralDirectoryLengthback to summary
public ZipShort getCentralDirectoryLength()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryLength.

Gets the central data length. If there is no central data, get the local file data length.

Returns:ZipShort

the central data length

Annotations
@Override
getHeaderIdback to summary
public ZipShort getHeaderId()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getHeaderId.

Gets the header id.

Returns:ZipShort

the header id

Annotations
@Override
getLocalFileDataDataback to summary
public byte[] getLocalFileDataData()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataData.

Gets the local data.

Returns:byte[]

the local data

Annotations
@Override
getLocalFileDataLengthback to summary
public ZipShort getLocalFileDataLength()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataLength.

Gets the length of the local data.

Returns:ZipShort

the length of the local data

Annotations
@Override
parseFromCentralDirectoryDataback to summary
public void parseFromCentralDirectoryData(final byte[] data, final int offset, final int length)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Populate data from this array as if it was in central directory data.

Parameters
data:byte[]

the array of bytes.

offset:int

the source location in the data array.

length:int

the number of bytes to use in the data array.

Annotations
@Override
See Also
ZipExtraField#parseFromCentralDirectoryData(byte[], int, int)
parseFromLocalFileDataback to summary
public void parseFromLocalFileData(final byte[] data, final int offset, final int length)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

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

Parameters
data:byte[]

the array of bytes.

offset:int

the source location in the data array.

length:int

the number of bytes to use in the data array.

Annotations
@Override
See Also
ZipExtraField#parseFromLocalFileData(byte[], int, int)
setCentralDirectoryDataback to summary
public void setCentralDirectoryData(final byte[] data)

Sets the extra field data in central directory.

Parameters
data:byte[]

the data to use

setHeaderIdback to summary
public void setHeaderId(final ZipShort headerId)

Sets the header id.

Parameters
headerId:ZipShort

the header id to use

setLocalFileDataDataback to summary
public void setLocalFileDataData(final byte[] data)

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

Parameters
data:byte[]

the field data to use