Class: LibLZMA::Stream::Decoder

Inherits:
LibLZMA::Stream show all
Defined in:
ext/liblzma.c

Instance Method Summary collapse

Methods inherited from LibLZMA::Stream

auto_decoder, decoder, encoder, #finish, #flush, raw_decoder, raw_encoder, #update

Constructor Details

#LZMA::Stream::Decoder.new(memlimit = nil, flags = nil) ⇒ Object



983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'ext/liblzma.c', line 983

static VALUE
decoder_init(int argc, VALUE argv[], VALUE self)
{
    VALUE memlimit0 = Qnil;
    VALUE flags0 = Qnil;
    uint64_t memlimit = UINT64_MAX;
    uint32_t flags = 0;
    rb_scan_args(argc, argv, "02", &memlimit0, &flags0);
    if (!NIL_P(flags0)) { flags = NUM2SIZET(flags0); }
    if (!NIL_P(memlimit0)) { memlimit = NUM2SIZET(memlimit0); }

    lzma_stream *stream = getstream(self);
    LZMA_TEST(lzma_stream_decoder(stream, memlimit, flags));

    return self;
}