[#BitStreamWriter]
= BitStreamWriter
:mrdocs:

Writes individual bits, most significant first, into an underlying byte stream&period;

== Synopsis

Declared in `&lt;streams&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename OStream&gt;
class BitStreamWriter;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BitStreamWriter/2constructor.adoc[`BitStreamWriter`]         [.small]#[constructor]#
| Construct a bit writer over the given output byte stream&period;
| xref:BitStreamWriter/2destructor.adoc[`&#126;BitStreamWriter`] [.small]#[destructor]#
| Flush any buffered bits, then destroy the writer&period;
| xref:BitStreamWriter/Flush.adoc[`Flush`] 
| Flush any unwritten bits to the output stream, padding with 0&apos;s to the next byte boundary&period;
| xref:BitStreamWriter/Write.adoc[`Write`] 
| Write the nbits least significant bits of a 64&hyphen;bit int to the output stream&period; Data is buffered until it completes an octet&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:GolombRiceEncode.adoc[`GolombRiceEncode`]
| Golomb&hyphen;Rice encode a value into a bit stream&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
