Context class

Compression context When compressing many times, it is recommended to allocate a context just once, and re-use it for each successive compression operation. This will make workload friendlier for system's memory. Note : re-using context is just a speed / resource optimization. It doesn't change the compression ratio, which remains identical. Note 2 : In multi-threaded environments, use one different context per thread for parallel execution.

Example: final ctx = Context.create(); try { ctx.compress(...); } finally { ctx.dispose(); // release }

Constructors

Context({required Pointer<ZSTD_CCtx_s>? ctx})
Context.create()
factory

Properties

ctx Pointer<ZSTD_CCtx_s>?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compress(Uint8List src, {int level = Level.levelDefault, Dict? dict}) Uint8List
dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited