bs_open() returns a bitstream connection object. When the
connection is a raw vector and mode = 'w', bs_close() returns
the final state of the raw vector; in all other cases bs_close()
does not return a value.
Arguments
con
A vector of raw values or an R connection (e.g. file(), url(), etc)
mode
Bitstream mode set to read or write? One of 'r', 'w', 'rb', 'wb'.
msb_first
Should the output mode be Most Signficant Bit first?
Default: TRUE
flush_threshold
Threshold number of bits at which the buffered data
will be automatically written to the connection.
Default: 8192 bits (1024 bytes). Note: Use bs_flush() to
write out the buffer at any time. All bits are automatically written out
when bs_close() is called.