Class LZ4FPreferences

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

public class LZ4FPreferences extends org.lwjgl.system.Struct<LZ4FPreferences> implements org.lwjgl.system.NativeResource
Makes it possible to supply advanced compression instructions to streaming interface. Structure must be first init to 0, using memset(), setting all parameters to default. All reserved fields must be set to zero.

Layout


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

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

      public int compressionLevel()
      0: default (fast mode); values > CLEVEL_MAX count as CLEVEL_MAX; values > 0 trigger "fast acceleration"
    • autoFlush

      public boolean autoFlush()
      1: always flush, reduces usage of internal buffers
    • favorDecSpeed

      public boolean favorDecSpeed()
      1: parser favors decompression speed vs compression ratio. Only works for high compression modes (≥ CLEVEL_OPT_MIN). Since version 1.8.2.
    • reserved

      public IntBuffer reserved()
      must be zero for forward compatibility
    • reserved

      public int reserved(int index)
      must be zero for forward compatibility
    • 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.
    • mallocStack

      @Deprecated public static LZ4FPreferences mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static LZ4FPreferences callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static LZ4FPreferences mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static LZ4FPreferences callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static LZ4FPreferences.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static LZ4FPreferences.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static LZ4FPreferences.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static LZ4FPreferences.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static LZ4FPreferences malloc(org.lwjgl.system.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(org.lwjgl.system.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, org.lwjgl.system.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, org.lwjgl.system.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.