Interface ZipExtraField
- All Known Implementing Classes:
AbstractUnicodeExtraField
,AsiExtraField
,JarMarker
,PKWareExtraHeader
,ResourceAlignmentExtraField
,UnicodeCommentExtraField
,UnicodePathExtraField
,UnparseableExtraFieldData
,UnrecognizedExtraField
,X000A_NTFS
,X0014_X509Certificates
,X0015_CertificateIdForFile
,X0016_CertificateIdForCentralDirectory
,X0017_StrongEncryptionHeader
,X0019_EncryptionRecipientCertificateList
,X5455_ExtendedTimestamp
,X7875_NewUnix
,Zip64ExtendedInformationExtraField
public interface ZipExtraField
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.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Size of an extra field header (id + length). -
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
parseFromCentralDirectoryData
(byte[] buffer, int offset, int length) Populate data from this array as if it was in central directory data.void
parseFromLocalFileData
(byte[] buffer, int offset, int length) Populate data from this array as if it was in local file data.
-
Field Details
-
EXTRAFIELD_HEADER_SIZE
Size of an extra field header (id + length).- Since:
- 1.14
- See Also:
-
-
Method Details
-
getCentralDirectoryData
byte[] getCentralDirectoryData()The actual data to put into central directory - without Header-ID or length specifier.- Returns:
- the data
-
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
-
getHeaderId
The Header-ID.- Returns:
- The HeaderId value
-
getLocalFileDataData
byte[] getLocalFileDataData()The actual data to put into local file data - without Header-ID or length specifier.- Returns:
- the data
-
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
-
parseFromCentralDirectoryData
Populate data from this array as if it was in central directory data.- Parameters:
buffer
- the buffer to read data fromoffset
- offset into buffer to read datalength
- the length of data- Throws:
ZipException
- on error
-
parseFromLocalFileData
Populate data from this array as if it was in local file data.- Parameters:
buffer
- the buffer to read data fromoffset
- offset into buffer to read datalength
- the length of data- Throws:
ZipException
- on error
-