Class LZ4FPreferences

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class LZ4FPreferences extends Struct<LZ4FPreferences> implements NativeResource

 struct LZ4F_preferences_t {
     LZ4F_frameInfo_t frameInfo;
     int compressionLevel;
     unsigned autoFlush;
     unsigned favorDecSpeed;
     unsigned reserved[3];
 }
  • Field Details

    • SIZEOF

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

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

      public static final int FRAMEINFO
      The struct member offsets.
    • COMPRESSIONLEVEL

      public static final int COMPRESSIONLEVEL
      The struct member offsets.
    • AUTOFLUSH

      public static final int AUTOFLUSH
      The struct member offsets.
    • FAVORDECSPEED

      public static final int FAVORDECSPEED
      The struct member offsets.
    • RESERVED

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

    • LZ4FPreferences

      public LZ4FPreferences(ByteBuffer container)
      Creates a LZ4FPreferences 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()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<LZ4FPreferences>
    • frameInfo

      public LZ4FFrameInfo frameInfo()
      Returns:
      a LZ4FFrameInfo view of the frameInfo field.
    • compressionLevel

      public int compressionLevel()
      Returns:
      the value of the compressionLevel field.
    • autoFlush

      public boolean autoFlush()
      Returns:
      the value of the autoFlush field.
    • favorDecSpeed

      public boolean favorDecSpeed()
      Returns:
      the value of the favorDecSpeed field.
    • reserved

      public IntBuffer reserved()
      Returns:
      a IntBuffer view of the reserved field.
    • reserved

      public int reserved(int index)
      Returns:
      the value at the specified index of the reserved field.
    • frameInfo

      public LZ4FPreferences frameInfo(LZ4FFrameInfo value)
      Copies the specified LZ4FFrameInfo to the frameInfo field.
    • frameInfo

      public LZ4FPreferences frameInfo(Consumer<LZ4FFrameInfo> consumer)
      Passes the frameInfo field to the specified Consumer.
    • compressionLevel

      public LZ4FPreferences compressionLevel(int value)
      Sets the specified value to the compressionLevel field.
    • autoFlush

      public LZ4FPreferences autoFlush(boolean value)
      Sets the specified value to the autoFlush field.
    • favorDecSpeed

      public LZ4FPreferences favorDecSpeed(boolean value)
      Sets the specified value to the favorDecSpeed field.
    • reserved

      public LZ4FPreferences reserved(IntBuffer value)
      Copies the specified IntBuffer to the reserved field.
    • reserved

      public LZ4FPreferences reserved(int index, int value)
      Sets the specified value at the specified index of the reserved field.
    • set

      public LZ4FPreferences set(LZ4FFrameInfo frameInfo, int compressionLevel, boolean autoFlush, boolean favorDecSpeed, IntBuffer reserved)
      Initializes this struct with the specified values.
    • set

      public LZ4FPreferences set(LZ4FPreferences src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

      public static LZ4FPreferences.Buffer create(int capacity)
      Returns a new LZ4FPreferences.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

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

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

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

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

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

      public static LZ4FPreferences.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new LZ4FPreferences.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
    • nframeInfo

      public static LZ4FFrameInfo nframeInfo(long struct)
      Unsafe version of frameInfo().
    • ncompressionLevel

      public static int ncompressionLevel(long struct)
      Unsafe version of compressionLevel().
    • nautoFlush

      public static int nautoFlush(long struct)
      Unsafe version of autoFlush().
    • nfavorDecSpeed

      public static int nfavorDecSpeed(long struct)
      Unsafe version of favorDecSpeed().
    • nreserved

      public static IntBuffer nreserved(long struct)
      Unsafe version of reserved().
    • nreserved

      public static int nreserved(long struct, int index)
      Unsafe version of reserved.
    • nframeInfo

      public static void nframeInfo(long struct, LZ4FFrameInfo value)
      Unsafe version of frameInfo.
    • ncompressionLevel

      public static void ncompressionLevel(long struct, int value)
      Unsafe version of compressionLevel.
    • nautoFlush

      public static void nautoFlush(long struct, int value)
      Unsafe version of autoFlush.
    • nfavorDecSpeed

      public static void nfavorDecSpeed(long struct, int value)
      Unsafe version of favorDecSpeed.
    • nreserved

      public static void nreserved(long struct, IntBuffer value)
      Unsafe version of reserved.
    • nreserved

      public static void nreserved(long struct, int index, int value)
      Unsafe version of reserved.