Class ZSTDSequence

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class ZSTDSequence
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct ZSTD_Sequence {
         unsigned int offset();
         unsigned int litLength();
         unsigned int matchLength();
         unsigned int rep();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ZSTDSequence.Buffer
      An array of ZSTDSequence structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int LITLENGTH
      MATCHLENGTH
      OFFSET
      REP
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      ZSTDSequence​(java.nio.ByteBuffer container)
      Creates a ZSTDSequence instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • OFFSET, LITLENGTH, MATCHLENGTH, REP

        The struct member offsets.
    • Constructor Detail

      • ZSTDSequence

        public ZSTDSequence​(java.nio.ByteBuffer container)
        Creates a ZSTDSequence instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • offset

        public int offset()
        the offset of the match. (NOT the same as the offset code)

        If offset == 0 and matchLength == 0, this sequence represents the last literals in the block of litLength size.

      • litLength

        public int litLength()
        literal length of the sequence
      • matchLength

        public int matchLength()
        match length of the sequence.

        Note: Users of this API may provide a sequence with matchLength == litLength == offset == 0. In this case, we will treat the sequence as a marker for a block boundary.

      • rep

        public int rep()
        Represents which repeat offset is represented by the field offset. Ranges from [0, 3].

        Repeat offsets are essentially previous offsets from previous sequences sorted in recency order. For more detail, see doc/zstd_compression_format.md.

        
         If rep == 0, then offset does not contain a repeat offset.
         If rep > 0:
             If litLength != 0:
                 rep == 1 --> offset == repeat_offset_1
                 rep == 2 --> offset == repeat_offset_2
                 rep == 3 --> offset == repeat_offset_3
             If litLength == 0:
                 rep == 1 --> offset == repeat_offset_2
                 rep == 2 --> offset == repeat_offset_3
                 rep == 3 --> offset == repeat_offset_1 - 1

        Note: This field is optional. generateSequences will calculate the value of rep, but repeat offsets do not necessarily need to be calculated from an external sequence provider's perspective. For example, compressSequences does not use this rep field at all (as of now).

      • malloc

        public static ZSTDSequence malloc()
        Returns a new ZSTDSequence instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static ZSTDSequence calloc()
        Returns a new ZSTDSequence instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static ZSTDSequence create()
        Returns a new ZSTDSequence instance allocated with BufferUtils.
      • create

        public static ZSTDSequence create​(long address)
        Returns a new ZSTDSequence instance for the specified memory address.
      • createSafe

        @Nullable
        public static ZSTDSequence createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static ZSTDSequence.Buffer malloc​(int capacity)
        Returns a new ZSTDSequence.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static ZSTDSequence.Buffer calloc​(int capacity)
        Returns a new ZSTDSequence.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static ZSTDSequence.Buffer create​(long address,
                                                 int capacity)
        Create a ZSTDSequence.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static ZSTDSequence.Buffer createSafe​(long address,
                                                     int capacity)
        Like create, but returns null if address is NULL.
      • malloc

        public static ZSTDSequence malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new ZSTDSequence instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static ZSTDSequence calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new ZSTDSequence instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static ZSTDSequence.Buffer malloc​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new ZSTDSequence.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static ZSTDSequence.Buffer calloc​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new ZSTDSequence.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • noffset

        public static int noffset​(long struct)
        Unsafe version of offset().
      • nlitLength

        public static int nlitLength​(long struct)
        Unsafe version of litLength().
      • nmatchLength

        public static int nmatchLength​(long struct)
        Unsafe version of matchLength().
      • nrep

        public static int nrep​(long struct)
        Unsafe version of rep().