Package 

Class GeneralPurposeBit

  • All Implemented Interfaces:
    java.lang.Cloneable

    
    public final class GeneralPurposeBit
     implements Cloneable
                        

    Parser/encoder for the "general purpose bit" field in ZIP's local file and central directory headers.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int UFT8_NAMES_FLAG
    • Method Summary

      Modifier and Type Method Description
      static GeneralPurposeBit parse(Array<byte> data, int offset) Parses the supported flags from the given archive data.
      Object clone()
      Array<byte> encode() Encodes the set bits in a form suitable for ZIP archives.
      void encode(Array<byte> buf, int offset) Encodes the set bits in a form suitable for ZIP archives.
      boolean equals(Object o)
      int hashCode()
      void useDataDescriptor(boolean b) whether the current entry will use the data descriptor to storeCRC and size information.
      void useEncryption(boolean b) whether the current entry will be encrypted.
      boolean usesDataDescriptor() whether the current entry uses the data descriptor to store CRCand size information.
      boolean usesEncryption() whether the current entry is encrypted.
      boolean usesStrongEncryption() whether the current entry is encrypted using strong encryption.
      void useStrongEncryption(boolean b) whether the current entry will be encrypted using strong encryption.
      boolean usesUTF8ForNames() whether the current entry uses UTF8 for file name and comment.
      void useUTF8ForNames(boolean b) whether the current entry will use UTF8 for file name and comment.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeneralPurposeBit

        GeneralPurposeBit()
    • Method Detail

      • parse

         static GeneralPurposeBit parse(Array<byte> data, int offset)

        Parses the supported flags from the given archive data.

        Parameters:
        data - local file header or a central directory entry.
        offset - offset at which the general purpose bit starts
      • encode

         Array<byte> encode()

        Encodes the set bits in a form suitable for ZIP archives.

      • encode

         void encode(Array<byte> buf, int offset)

        Encodes the set bits in a form suitable for ZIP archives.

        Parameters:
        buf - the output buffer
        offset - The offset within the output buffer of the first byte to be written.
      • useDataDescriptor

         void useDataDescriptor(boolean b)

        whether the current entry will use the data descriptor to storeCRC and size information.

        Parameters:
        b - whether the current entry will use the data descriptor to storeCRC and size information
      • useEncryption

         void useEncryption(boolean b)

        whether the current entry will be encrypted.

        Parameters:
        b - whether the current entry will be encrypted
      • usesDataDescriptor

         boolean usesDataDescriptor()

        whether the current entry uses the data descriptor to store CRCand size information.

      • usesEncryption

         boolean usesEncryption()

        whether the current entry is encrypted.

      • usesStrongEncryption

         boolean usesStrongEncryption()

        whether the current entry is encrypted using strong encryption.

      • useStrongEncryption

         void useStrongEncryption(boolean b)

        whether the current entry will be encrypted using strong encryption.

        Parameters:
        b - whether the current entry will be encrypted using strong encryption
      • usesUTF8ForNames

         boolean usesUTF8ForNames()

        whether the current entry uses UTF8 for file name and comment.

      • useUTF8ForNames

         void useUTF8ForNames(boolean b)

        whether the current entry will use UTF8 for file name and comment.

        Parameters:
        b - whether the current entry will use UTF8 for file name and comment.