Package org.zeroturnaround.zip.extra
Interface ZipExtraField
- All Known Implementing Classes:
AsiExtraField
,UnrecognizedExtraField
public interface ZipExtraField
This is a class that has been made significantly smaller (deleted a bunch of methods) and originally
is from the Apache Ant Project (http://ant.apache.org), org.apache.tools.zip package.
All license and other documentation is intact.
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 TypeMethodDescriptionbyte[]
The actual data to put into central directory - without Header-ID or length specifier.Length of the extra field in the central directory - without Header-ID or length specifier.The Header-ID.byte[]
The actual data to put into local file data - without Header-ID or length specifier.Length of the extra field in the local file data - without Header-ID or length specifier.void
parseFromLocalFileData
(byte[] data, int offset, int length) Populate data from this array as if it was in local file data.
-
Method Details
-
getHeaderId
ZipShort getHeaderId()The Header-ID.- Returns:
- the header id
- Since:
- 1.1
-
getLocalFileDataLength
ZipShort getLocalFileDataLength()Length of the extra field in the local file data - without Header-ID or length specifier.- Returns:
- the length of the field in the local file data
- Since:
- 1.1
-
getCentralDirectoryLength
ZipShort getCentralDirectoryLength()Length of the extra field in the central directory - without Header-ID or length specifier.- Returns:
- the length of the field in the central directory
- Since:
- 1.1
-
getLocalFileDataData
byte[] getLocalFileDataData()The actual data to put into local file data - without Header-ID or length specifier.- Returns:
- the data
- Since:
- 1.1
-
getCentralDirectoryData
byte[] getCentralDirectoryData()The actual data to put into central directory - without Header-ID or length specifier.- Returns:
- the data
- Since:
- 1.1
-
parseFromLocalFileData
Populate data from this array as if it was in local file data.- Parameters:
data
- an array of bytesoffset
- the start offsetlength
- the number of bytes in the array from offset- Throws:
ZipException
- on error- Since:
- 1.1
-