class Zstd::Compress::Context

Overview

Usage:

cctx = Zstd::Compress::Context.new
buf = Bytes.new 22
cbuf = cctx.compress buf

Defined in:

Constructors

Instance Method Summary

Instance methods inherited from class Zstd::Context

close close, dup dup, finalize finalize

Constructor Detail

def self.new(level : Int32 = LEVEL_DEFAULT, *, dict : Zstd::Dict? = nil) #

Instance Method Detail

def checksum #

def checksum=(value : Bool) #

def compress(src : Bytes, dst : Bytes = Bytes.new(compress_bound(src.bytesize))) : Bytes #

def compress_bound(size) #

Maximum output buffer size for compression


def dict : Zstd::Dict? #

def dict=(d : Zstd::Dict) #

Overrides compression level.


def level #

def level=(val) #

def memsize #

Give the current memory usage of zstd context.

Note that object memory usage can evolve (increase or decrease) over time.


def threads #

def threads=(val) #