java.lang.Object
kala.compress.harmony.unpack200.SegmentOptions

public class SegmentOptions extends Object
Stores the combinations of bit flags that can be used in the segment header options. Whilst this could be defined in Segment, it's cleaner to pull it out into a separate class, not least because methods can then be used to determine the semantic meaning of the flags. In languages with a pre-processor, these may be defined by macros that do bitflag manipulation instead.
  • Field Details

    • DEFLATE_HINT

      private static final int DEFLATE_HINT
      See Also:
    • HAVE_ALL_CODE_FLAGS

      private static final int HAVE_ALL_CODE_FLAGS
      See Also:
    • HAVE_CLASS_FLAGS_HI

      private static final int HAVE_CLASS_FLAGS_HI
      See Also:
    • HAVE_CODE_FLAGS_HI

      private static final int HAVE_CODE_FLAGS_HI
      See Also:
    • HAVE_CP_NUMBERS

      private static final int HAVE_CP_NUMBERS
      See Also:
    • HAVE_FIELD_FLAGS_HI

      private static final int HAVE_FIELD_FLAGS_HI
      See Also:
    • HAVE_FILE_HEADERS

      private static final int HAVE_FILE_HEADERS
      See Also:
    • HAVE_FILE_MODTIME

      private static final int HAVE_FILE_MODTIME
      See Also:
    • HAVE_FILE_OPTIONS

      private static final int HAVE_FILE_OPTIONS
      See Also:
    • HAVE_FILE_SIZE_HI

      private static final int HAVE_FILE_SIZE_HI
      See Also:
    • HAVE_METHOD_FLAGS_HI

      private static final int HAVE_METHOD_FLAGS_HI
      See Also:
    • HAVE_SPECIAL_FORMATS

      private static final int HAVE_SPECIAL_FORMATS
      See Also:
    • UNUSED

      private static final int UNUSED
      The bit flags that are defined as unused by the specification; specifically, every bit above bit 13 and bit 3.
      See Also:
    • options

      private final int options
  • Constructor Details

    • SegmentOptions

      public SegmentOptions(int options) throws Pack200Exception
      Creates a new segment options with the given integer value.
      Parameters:
      options - the integer value to use as the flags
      Throws:
      Pack200Exception - if an unused bit (bit 3 or bit 13+) is non-zero
  • Method Details

    • hasAllCodeFlags

      public boolean hasAllCodeFlags()
    • hasArchiveFileCounts

      public boolean hasArchiveFileCounts()
    • hasClassFlagsHi

      public boolean hasClassFlagsHi()
    • hasCodeFlagsHi

      public boolean hasCodeFlagsHi()
    • hasCPNumberCounts

      public boolean hasCPNumberCounts()
    • hasFieldFlagsHi

      public boolean hasFieldFlagsHi()
    • hasFileModtime

      public boolean hasFileModtime()
    • hasFileOptions

      public boolean hasFileOptions()
    • hasFileSizeHi

      public boolean hasFileSizeHi()
    • hasMethodFlagsHi

      public boolean hasMethodFlagsHi()
    • hasSpecialFormats

      public boolean hasSpecialFormats()
    • shouldDeflate

      public boolean shouldDeflate()