Enum DataDescriptorType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DataDescriptorType>

    public enum DataDescriptorType
    extends java.lang.Enum<DataDescriptorType>
    Type of data descriptor that an entry has. Data descriptors are used if the CRC and sizing data is not known when the data is being written and cannot be placed in the file's local header. In those cases, after the file data itself, a data descriptor is placed after the entry's contents.

    While the zip specification says the data descriptor should be used but it is optional. We record also whether the data descriptor contained the 4-byte signature at the start of the block or not.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int size
      The number of bytes the data descriptor spans.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DataDescriptorType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DataDescriptorType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NO_DATA_DESCRIPTOR

        public static final DataDescriptorType NO_DATA_DESCRIPTOR
        The entry has no data descriptor.
      • DATA_DESCRIPTOR_WITHOUT_SIGNATURE

        public static final DataDescriptorType DATA_DESCRIPTOR_WITHOUT_SIGNATURE
        The entry has a data descriptor that does not contain a signature.
      • DATA_DESCRIPTOR_WITH_SIGNATURE

        public static final DataDescriptorType DATA_DESCRIPTOR_WITH_SIGNATURE
        The entry has a data descriptor that contains a signature.
    • Field Detail

      • size

        public int size
        The number of bytes the data descriptor spans.
    • Method Detail

      • values

        public static DataDescriptorType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DataDescriptorType c : DataDescriptorType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DataDescriptorType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null