bs_peek {bitstreamio}R Documentation

Peek at bits from a bitstream i.e. examine bits without advancing bitstream

Description

Peek at bits from a bitstream i.e. examine bits without advancing bitstream

Usage

bs_peek(bs, n)

Arguments

bs

Bistream connection object created with bs_open()

n

number of bits to peek.

Value

logical vector of bit values

Examples

raw_vec <- as.raw(1:3)
bs  <- bs_open(raw_vec, 'r')
bs_peek(bs, 4)
stopifnot(bs_is_aligned(bs))
bs_close(bs)

[Package bitstreamio version 0.1.0 Index]