Class FastZipEntry

    • Field Detail

      • entryName

        public final String entryName
        The zip entry path.
      • isDeflated

        public final boolean isDeflated
        True if the zip entry is deflated; false if the zip entry is stored.
      • compressedSize

        public final long compressedSize
        The compressed size of the zip entry, in bytes.
      • uncompressedSize

        public final long uncompressedSize
        The uncompressed size of the zip entry, in bytes.
      • version

        public final int version
        The version code (>= 9), or 8 for the base layer or a non-versioned jar (whether JDK 7 or 8 compatible).
      • entryNameUnversioned

        public final String entryNameUnversioned
        The unversioned entry name (i.e. entryName with "META_INF/versions/{versionInt}/" stripped)
    • Constructor Detail

      • FastZipEntry

        public FastZipEntry​(LogicalZipFile parentLogicalZipFile,
                            long locHeaderPos,
                            String entryName,
                            boolean isDeflated,
                            long compressedSize,
                            long uncompressedSize,
                            NestedJarHandler nestedJarHandler)
        Parameters:
        parentLogicalZipFile - The parent logical zipfile containing this entry.
        locHeaderPos - The offset of the LOC header for this entry within the parent logical zipfile.
        entryName - The name of the entry.
        isDeflated - True if the entry is deflated; false if the entry is stored.
        compressedSize - The compressed size of the entry.
        uncompressedSize - The uncompressed size of the entry.
        nestedJarHandler - The NestedJarHandler.
    • Method Detail

      • canGetAsSlice

        public boolean canGetAsSlice()
                              throws IOException
        Returns:
        true if the zip entry can be opened as a ByteBuffer slice -- the entry must be STORED, and span only one 2GB buffer chunk.
        Throws:
        IOException
      • load

        public byte[] load​(LogNode log)
                    throws IOException
        Load the content of the zip entry, and return it as a byte array.
        Throws:
        IOException
      • loadAsString

        public String loadAsString​(LogNode log)
                            throws IOException
        Load the content of the zip entry, and return it as a String (converting from UTF-8 byte format).
        Throws:
        IOException
      • getPath

        public String getPath()
        Get the path to this zip entry, using "!/" as a separator between the parent logical zipfile and the entry name.
      • compareTo

        public int compareTo​(FastZipEntry o)
        Sort in decreasing order of version number, then lexicographically increasing order of unversioned entry path.
        Specified by:
        compareTo in interface Comparable<FastZipEntry>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object