Interface ZipExtraField

  • All Known Implementing Classes:
    AsiExtraField, UnrecognizedExtraField

    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.

    Version:
    $Revision: 155439 $
    Author:
    Stefan Bodewig
    • Method Detail

      • getHeaderID

        ZipShort getHeaderID()
        The Header-ID.
        Returns:
        The HeaderId value
        Since:
        1.1
      • getLocalFileDataLength

        ZipShort getLocalFileDataLength()
        Length of the extra field in the local file data - without Header-ID or length specifier.
        Returns:
        The LocalFileDataLength value
        Since:
        1.1
      • getCentralDirectoryLength

        ZipShort getCentralDirectoryLength()
        Length of the extra field in the central directory - without Header-ID or length specifier.
        Returns:
        The CentralDirectoryLength value
        Since:
        1.1
      • getLocalFileDataData

        byte[] getLocalFileDataData()
        The actual data to put into local file data - without Header-ID or length specifier.
        Returns:
        The LocalFileDataData value
        Since:
        1.1
      • getCentralDirectoryData

        byte[] getCentralDirectoryData()
        The actual data to put central directory - without Header-ID or length specifier.
        Returns:
        The CentralDirectoryData value
        Since:
        1.1
      • parseFromLocalFileData

        void parseFromLocalFileData​(byte[] buffer,
                                    int offset,
                                    int length)
                             throws java.util.zip.ZipException
        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
        Throws:
        java.util.zip.ZipException - on error
        Since:
        1.1