Class LZ4FPreferences

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

    public class LZ4FPreferences
    extends Struct
    implements NativeResource

    Member documentation

    • compressionLevel – 0: default (fast mode); values > CLEVEL_MAX count as CLEVEL_MAX; values > 0 trigger "fast acceleration"
    • autoFlush – 1: always flush, to reduce usage of internal buffers
    • favorDecSpeed – 1: parser favors decompression speed vs compression ratio. Only works for high compression modes (≥ CLEVEL_OPT_MIN). Since version 1.8.2.
    • reserved – must be zero for forward compatibility

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • FRAMEINFO, COMPRESSIONLEVEL, AUTOFLUSH, FAVORDECSPEED, RESERVED

        The struct member offsets.
    • Constructor Detail

      • LZ4FPreferences

        public LZ4FPreferences​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • frameInfo

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

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

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

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

        public java.nio.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.
      • compressionLevel

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

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

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

        public LZ4FPreferences reserved​(java.nio.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,
                                   int autoFlush,
                                   int favorDecSpeed,
                                   java.nio.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
      • createSafe

        @Nullable
        public static LZ4FPreferences createSafe​(long address)
        Like create, but returns null if address is NULL.
      • 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

        @Nullable
        public static LZ4FPreferences.Buffer createSafe​(long address,
                                                        int capacity)
        Like create, but returns null if address is NULL.
      • 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 java.nio.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,
                                     java.nio.IntBuffer value)
        Unsafe version of reserved.
      • nreserved

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