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.NativeResource
Makes 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.Member documentation
compressionLevel
– 0: default (fast mode); values >CLEVEL_MAX
count asCLEVEL_MAX
; values > 0 trigger "fast acceleration"autoFlush
– 1: always flush, reduces usage of internal buffersfavorDecSpeed
– 1: parser favors decompression speed vs compression ratio. Only works for high compression modes (≥CLEVEL_OPT_MIN
). Since version 1.8.2.reserved[3]
– must be zero for forward compatibility
Layout
struct LZ4F_preferences_t {
LZ4F_frameInfo_t
frameInfo; int compressionLevel; unsigned autoFlush; unsigned favorDecSpeed; unsigned reserved[3]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LZ4FPreferences.Buffer
An array ofLZ4FPreferences
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
AUTOFLUSH
COMPRESSIONLEVEL
FAVORDECSPEED
FRAMEINFO
RESERVEDThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description LZ4FPreferences(java.nio.ByteBuffer container)
Creates aLZ4FPreferences
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
autoFlush()
Returns the value of theautoFlush
field.LZ4FPreferences
autoFlush(boolean value)
Sets the specified value to theautoFlush
field.static LZ4FPreferences
calloc()
Returns a newLZ4FPreferences
instance allocated withmemCalloc
.static LZ4FPreferences.Buffer
calloc(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated withmemCalloc
.static LZ4FPreferences
callocStack()
Returns a newLZ4FPreferences
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static LZ4FPreferences.Buffer
callocStack(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static LZ4FPreferences.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static LZ4FPreferences
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.int
compressionLevel()
Returns the value of thecompressionLevel
field.LZ4FPreferences
compressionLevel(int value)
Sets the specified value to thecompressionLevel
field.static LZ4FPreferences
create()
Returns a newLZ4FPreferences
instance allocated withBufferUtils
.static LZ4FPreferences.Buffer
create(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated withBufferUtils
.static LZ4FPreferences
create(long address)
Returns a newLZ4FPreferences
instance for the specified memory address.static LZ4FPreferences.Buffer
create(long address, int capacity)
Create aLZ4FPreferences.Buffer
instance at the specified memory.static LZ4FPreferences
createSafe(long address)
static LZ4FPreferences.Buffer
createSafe(long address, int capacity)
boolean
favorDecSpeed()
Returns the value of thefavorDecSpeed
field.LZ4FPreferences
favorDecSpeed(boolean value)
Sets the specified value to thefavorDecSpeed
field.LZ4FFrameInfo
frameInfo()
Returns aLZ4FFrameInfo
view of theframeInfo
field.LZ4FPreferences
frameInfo(java.util.function.Consumer<LZ4FFrameInfo> consumer)
Passes theframeInfo
field to the specifiedConsumer
.LZ4FPreferences
frameInfo(LZ4FFrameInfo value)
Copies the specifiedLZ4FFrameInfo
to theframeInfo
field.static LZ4FPreferences
malloc()
Returns a newLZ4FPreferences
instance allocated withmemAlloc
.static LZ4FPreferences.Buffer
malloc(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated withmemAlloc
.static LZ4FPreferences
mallocStack()
Returns a newLZ4FPreferences
instance allocated on the thread-localMemoryStack
.static LZ4FPreferences.Buffer
mallocStack(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated on the thread-localMemoryStack
.static LZ4FPreferences.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences.Buffer
instance allocated on the specifiedMemoryStack
.static LZ4FPreferences
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences
instance allocated on the specifiedMemoryStack
.static int
nautoFlush(long struct)
Unsafe version ofautoFlush()
.static void
nautoFlush(long struct, int value)
Unsafe version ofautoFlush
.static int
ncompressionLevel(long struct)
Unsafe version ofcompressionLevel()
.static void
ncompressionLevel(long struct, int value)
Unsafe version ofcompressionLevel
.static int
nfavorDecSpeed(long struct)
Unsafe version offavorDecSpeed()
.static void
nfavorDecSpeed(long struct, int value)
Unsafe version offavorDecSpeed
.static LZ4FFrameInfo
nframeInfo(long struct)
Unsafe version offrameInfo()
.static void
nframeInfo(long struct, LZ4FFrameInfo value)
Unsafe version offrameInfo
.static java.nio.IntBuffer
nreserved(long struct)
Unsafe version ofreserved()
.static int
nreserved(long struct, int index)
Unsafe version ofreserved
.static void
nreserved(long struct, int index, int value)
Unsafe version ofreserved
.static void
nreserved(long struct, java.nio.IntBuffer value)
Unsafe version ofreserved
.java.nio.IntBuffer
reserved()
Returns aIntBuffer
view of thereserved
field.int
reserved(int index)
Returns the value at the specified index of thereserved
field.LZ4FPreferences
reserved(int index, int value)
Sets the specified value at the specified index of thereserved
field.LZ4FPreferences
reserved(java.nio.IntBuffer value)
Copies the specifiedIntBuffer
to thereserved
field.LZ4FPreferences
set(LZ4FFrameInfo frameInfo, int compressionLevel, boolean autoFlush, boolean favorDecSpeed, java.nio.IntBuffer reserved)
Initializes this struct with the specified values.LZ4FPreferences
set(LZ4FPreferences src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
LZ4FPreferences
public LZ4FPreferences(java.nio.ByteBuffer container)
Creates aLZ4FPreferences
instance at the current position of the specifiedByteBuffer
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()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
frameInfo
public LZ4FFrameInfo frameInfo()
Returns aLZ4FFrameInfo
view of theframeInfo
field.
-
compressionLevel
public int compressionLevel()
Returns the value of thecompressionLevel
field.
-
autoFlush
public boolean autoFlush()
Returns the value of theautoFlush
field.
-
favorDecSpeed
public boolean favorDecSpeed()
Returns the value of thefavorDecSpeed
field.
-
reserved
public java.nio.IntBuffer reserved()
Returns aIntBuffer
view of thereserved
field.
-
reserved
public int reserved(int index)
Returns the value at the specified index of thereserved
field.
-
frameInfo
public LZ4FPreferences frameInfo(LZ4FFrameInfo value)
Copies the specifiedLZ4FFrameInfo
to theframeInfo
field.
-
frameInfo
public LZ4FPreferences frameInfo(java.util.function.Consumer<LZ4FFrameInfo> consumer)
Passes theframeInfo
field 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 specifiedIntBuffer
to 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 newLZ4FPreferences
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static LZ4FPreferences calloc()
Returns a newLZ4FPreferences
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static LZ4FPreferences create()
Returns a newLZ4FPreferences
instance allocated withBufferUtils
.
-
create
public static LZ4FPreferences create(long address)
Returns a newLZ4FPreferences
instance for the specified memory address.
-
createSafe
@Nullable public static LZ4FPreferences createSafe(long address)
-
malloc
public static LZ4FPreferences.Buffer malloc(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static LZ4FPreferences.Buffer calloc(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static LZ4FPreferences.Buffer create(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static LZ4FPreferences.Buffer create(long address, int capacity)
Create aLZ4FPreferences.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static LZ4FPreferences.Buffer createSafe(long address, int capacity)
-
mallocStack
public static LZ4FPreferences mallocStack()
Returns a newLZ4FPreferences
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static LZ4FPreferences callocStack()
Returns a newLZ4FPreferences
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static LZ4FPreferences mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static LZ4FPreferences callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static LZ4FPreferences.Buffer mallocStack(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static LZ4FPreferences.Buffer callocStack(int capacity)
Returns a newLZ4FPreferences.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static LZ4FPreferences.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static LZ4FPreferences.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newLZ4FPreferences.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-