Learn R Programming

bitstreamio (version 0.1.0)

bs_write_bit: Write unaligned bits to a bitstream

Description

Write unaligned bits to a bitstream

Usage

bs_write_bit(bs, x)

Value

Bitstream connection returned invisibly

Arguments

bs

Bistream connection object created with bs_open()

x

Logical vector of bit values

Examples

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

Run the code above in your browser using DataLab