Package org.lwjgl.util.lz4
Class LZ4FPreferences
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.lz4.LZ4FPreferences
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class LZ4FPreferences extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceMakes it possible to supply advanced compression instructions to streaming interface. Structure must be first init to 0, usingmemset(), setting all parameters to default. All reserved fields must be set to zero.Layout
struct LZ4F_preferences_t {LZ4F_frameInfo_tframeInfo; intcompressionLevel(); unsignedautoFlush(); unsignedfavorDecSpeed(); unsignedreserved()[3]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLZ4FPreferences.BufferAn array ofLZ4FPreferencesstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intAUTOFLUSH
COMPRESSIONLEVEL
FAVORDECSPEED
FRAMEINFO
RESERVEDThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description LZ4FPreferences(java.nio.ByteBuffer container)Creates aLZ4FPreferencesinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanautoFlush()1: always flush, reduces usage of internal buffersLZ4FPreferencesautoFlush(boolean value)Sets the specified value to theautoFlush()field.static LZ4FPreferencescalloc()Returns a newLZ4FPreferencesinstance allocated withmemCalloc.static LZ4FPreferences.Buffercalloc(int capacity)Returns a newLZ4FPreferences.Bufferinstance allocated withmemCalloc.static LZ4FPreferences.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newLZ4FPreferences.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static LZ4FPreferencescalloc(org.lwjgl.system.MemoryStack stack)Returns a newLZ4FPreferencesinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static LZ4FPreferencescallocStack()Deprecated.static LZ4FPreferences.BuffercallocStack(int capacity)Deprecated.static LZ4FPreferences.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static LZ4FPreferencescallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.intcompressionLevel()0: default (fast mode); values >CLEVEL_MAXcount asCLEVEL_MAX; values > 0 trigger "fast acceleration"LZ4FPreferencescompressionLevel(int value)Sets the specified value to thecompressionLevel()field.static LZ4FPreferencescreate()Returns a newLZ4FPreferencesinstance allocated withBufferUtils.static LZ4FPreferences.Buffercreate(int capacity)Returns a newLZ4FPreferences.Bufferinstance allocated withBufferUtils.static LZ4FPreferencescreate(long address)Returns a newLZ4FPreferencesinstance for the specified memory address.static LZ4FPreferences.Buffercreate(long address, int capacity)Create aLZ4FPreferences.Bufferinstance at the specified memory.static LZ4FPreferencescreateSafe(long address)static LZ4FPreferences.BuffercreateSafe(long address, int capacity)booleanfavorDecSpeed()1: parser favors decompression speed vs compression ratio.LZ4FPreferencesfavorDecSpeed(boolean value)Sets the specified value to thefavorDecSpeed()field.LZ4FFrameInfoframeInfo()LZ4FPreferencesframeInfo(java.util.function.Consumer<LZ4FFrameInfo> consumer)Passes theframeInfofield to the specifiedConsumer.LZ4FPreferencesframeInfo(LZ4FFrameInfo value)Copies the specifiedLZ4FFrameInfoto theframeInfofield.static LZ4FPreferencesmalloc()Returns a newLZ4FPreferencesinstance allocated withmemAlloc.static LZ4FPreferences.Buffermalloc(int capacity)Returns a newLZ4FPreferences.Bufferinstance allocated withmemAlloc.static LZ4FPreferences.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newLZ4FPreferences.Bufferinstance allocated on the specifiedMemoryStack.static LZ4FPreferencesmalloc(org.lwjgl.system.MemoryStack stack)Returns a newLZ4FPreferencesinstance allocated on the specifiedMemoryStack.static LZ4FPreferencesmallocStack()Deprecated.static LZ4FPreferences.BuffermallocStack(int capacity)Deprecated.static LZ4FPreferences.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static LZ4FPreferencesmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static intnautoFlush(long struct)Unsafe version ofautoFlush().static voidnautoFlush(long struct, int value)Unsafe version ofautoFlush.static intncompressionLevel(long struct)Unsafe version ofcompressionLevel().static voidncompressionLevel(long struct, int value)Unsafe version ofcompressionLevel.static intnfavorDecSpeed(long struct)Unsafe version offavorDecSpeed().static voidnfavorDecSpeed(long struct, int value)Unsafe version offavorDecSpeed.static LZ4FFrameInfonframeInfo(long struct)Unsafe version offrameInfo().static voidnframeInfo(long struct, LZ4FFrameInfo value)Unsafe version offrameInfo.static java.nio.IntBuffernreserved(long struct)Unsafe version ofreserved().static intnreserved(long struct, int index)Unsafe version ofreserved.static voidnreserved(long struct, int index, int value)Unsafe version ofreserved.static voidnreserved(long struct, java.nio.IntBuffer value)Unsafe version ofreserved.java.nio.IntBufferreserved()must be zero for forward compatibilityintreserved(int index)must be zero for forward compatibilityLZ4FPreferencesreserved(int index, int value)Sets the specified value at the specified index of thereserved()field.LZ4FPreferencesreserved(java.nio.IntBuffer value)Copies the specifiedIntBufferto thereserved()field.LZ4FPreferencesset(LZ4FFrameInfo frameInfo, int compressionLevel, boolean autoFlush, boolean favorDecSpeed, java.nio.IntBuffer reserved)Initializes this struct with the specified values.LZ4FPreferencesset(LZ4FPreferences src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
LZ4FPreferences
public LZ4FPreferences(java.nio.ByteBuffer container)
Creates aLZ4FPreferencesinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
frameInfo
public LZ4FFrameInfo frameInfo()
- Returns:
- a
LZ4FFrameInfoview of theframeInfofield.
-
compressionLevel
public int compressionLevel()
0: default (fast mode); values >CLEVEL_MAXcount asCLEVEL_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 java.nio.IntBuffer reserved() public int reserved(int index)
must be zero for forward compatibility
-
frameInfo
public LZ4FPreferences frameInfo(LZ4FFrameInfo value)
Copies the specifiedLZ4FFrameInfoto theframeInfofield.
-
frameInfo
public LZ4FPreferences frameInfo(java.util.function.Consumer<LZ4FFrameInfo> consumer)
Passes theframeInfofield to the specifiedConsumer.
-
compressionLevel
public LZ4FPreferences compressionLevel(int value)
Sets the specified value to thecompressionLevel()field.
-
autoFlush
public LZ4FPreferences autoFlush(boolean value)
Sets the specified value to theautoFlush()field.
-
favorDecSpeed
public LZ4FPreferences favorDecSpeed(boolean value)
Sets the specified value to thefavorDecSpeed()field.
-
reserved
public LZ4FPreferences reserved(java.nio.IntBuffer value)
Copies the specifiedIntBufferto thereserved()field.
-
reserved
public LZ4FPreferences reserved(int index, int value)
Sets the specified value at the specified index of thereserved()field.
-
set
public LZ4FPreferences set(LZ4FFrameInfo frameInfo, int compressionLevel, boolean autoFlush, boolean 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
-
malloc
public static LZ4FPreferences malloc()
Returns a newLZ4FPreferencesinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static LZ4FPreferences calloc()
Returns a newLZ4FPreferencesinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static LZ4FPreferences create()
Returns a newLZ4FPreferencesinstance allocated withBufferUtils.
-
create
public static LZ4FPreferences create(long address)
Returns a newLZ4FPreferencesinstance for the specified memory address.
-
createSafe
@Nullable public static LZ4FPreferences createSafe(long address)
-
malloc
public static LZ4FPreferences.Buffer malloc(int capacity)
Returns a newLZ4FPreferences.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static LZ4FPreferences.Buffer calloc(int capacity)
Returns a newLZ4FPreferences.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static LZ4FPreferences.Buffer create(int capacity)
Returns a newLZ4FPreferences.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static LZ4FPreferences.Buffer create(long address, int capacity)
Create aLZ4FPreferences.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static LZ4FPreferences.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static LZ4FPreferences mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static LZ4FPreferences callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static LZ4FPreferences mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static LZ4FPreferences callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static LZ4FPreferences.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static LZ4FPreferences.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(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. Usemalloc(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. Usecalloc(int, MemoryStack)instead.
-
malloc
public static LZ4FPreferences malloc(org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferencesinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static LZ4FPreferences calloc(org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferencesinstance allocated on the specifiedMemoryStackand 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 newLZ4FPreferences.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static LZ4FPreferences.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nframeInfo
public static LZ4FFrameInfo nframeInfo(long struct)
Unsafe version offrameInfo().
-
ncompressionLevel
public static int ncompressionLevel(long struct)
Unsafe version ofcompressionLevel().
-
nautoFlush
public static int nautoFlush(long struct)
Unsafe version ofautoFlush().
-
nfavorDecSpeed
public static int nfavorDecSpeed(long struct)
Unsafe version offavorDecSpeed().
-
nreserved
public static java.nio.IntBuffer nreserved(long struct)
Unsafe version ofreserved().
-
nreserved
public static int nreserved(long struct, int index)Unsafe version ofreserved.
-
nframeInfo
public static void nframeInfo(long struct, LZ4FFrameInfo value)Unsafe version offrameInfo.
-
ncompressionLevel
public static void ncompressionLevel(long struct, int value)Unsafe version ofcompressionLevel.
-
nautoFlush
public static void nautoFlush(long struct, int value)Unsafe version ofautoFlush.
-
nfavorDecSpeed
public static void nfavorDecSpeed(long struct, int value)Unsafe version offavorDecSpeed.
-
nreserved
public static void nreserved(long struct, java.nio.IntBuffer value)Unsafe version ofreserved.
-
nreserved
public static void nreserved(long struct, int index, int value)Unsafe version ofreserved.
-
-