bs_align {bitstreamio}R Documentation

Align the bitstream to the given number of bits - relative to start of bitstream

Description

Align the bitstream to the given number of bits - relative to start of bitstream

Usage

bs_align(bs, nbits = 8L, value = FALSE)

Arguments

bs

Bistream connection object created with bs_open()

nbits

number of bits of alignment w.r.t start of bitstream. Default: 8

value

bit fill value. Either TRUE or FALSE. Default FALSE

Value

Bitstream connection returned invisibly

Examples

bs  <- bs_open(raw(), 'w')
bs_write_bit(bs, c(TRUE, FALSE, TRUE))
bs_is_aligned(bs, 8)
bs_align(bs, nbits = 8)
bs_is_aligned(bs, 8)
output <- bs_close(bs)
output

[Package bitstreamio version 0.1.0 Index]