Class ZSTDSequence

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<ZSTDSequence>
org.lwjgl.util.zstd.ZSTDSequence
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class ZSTDSequence extends org.lwjgl.system.Struct<ZSTDSequence> 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 
    An array of ZSTDSequence structs.

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

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    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
    Creates a ZSTDSequence instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new ZSTDSequence instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new ZSTDSequence.Buffer instance allocated with memCalloc.
    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.
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new ZSTDSequence instance allocated on the specified MemoryStack and initializes all its bits to zero.
    Returns a new ZSTDSequence instance allocated with BufferUtils.
    create(int capacity)
    Returns a new ZSTDSequence.Buffer instance allocated with BufferUtils.
    create(long address)
    Returns a new ZSTDSequence instance for the specified memory address.
    create(long address, int capacity)
    Create a ZSTDSequence.Buffer instance at the specified memory.
    static @Nullable ZSTDSequence
    createSafe(long address)
    Like create, but returns null if address is NULL.
    static @Nullable ZSTDSequence.Buffer
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    int
    literal length of the sequence
    Returns a new ZSTDSequence instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new ZSTDSequence.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new ZSTDSequence.Buffer instance allocated on the specified MemoryStack.
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new ZSTDSequence instance allocated on the specified MemoryStack.
    int
    match length of the sequence.
    static int
    nlitLength(long struct)
    Unsafe version of litLength().
    static int
    nmatchLength(long struct)
    Unsafe version of matchLength().
    static int
    noffset(long struct)
    Unsafe version of offset().
    static int
    nrep(long struct)
    Unsafe version of rep().
    int
    the offset of the match.
    int
    rep()
    Represents which repeat offset is represented by the field offset.
    int
     

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • OFFSET

      public static final int OFFSET
      The struct member offsets.
    • LITLENGTH

      public static final int LITLENGTH
      The struct member offsets.
    • MATCHLENGTH

      public static final int MATCHLENGTH
      The struct member offsets.
    • REP

      public static final int REP
      The struct member offsets.
  • Constructor Details

    • ZSTDSequence

      public ZSTDSequence(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 Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<ZSTDSequence>
    • 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.

    • 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

      public static @Nullable 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(int capacity)
      Returns a new ZSTDSequence.Buffer instance allocated with BufferUtils.
      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

      public static @Nullable 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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().