#include "bitstream.h"

class ibitstream : public std::istream

This base class reads bits of data from various input sources. This is an abstract base class that inherits from the standard C++ istream class. You are not likely to want to construct an ibitstream directly. Instead, you should probably construct an ifbitstream to read from a file, or an istringbitstream to read from the bytes of a string buffer.

Available since: 2014/02/01 version of C++ library

Methods
readBit()  Reads a single bit from the bit stream and returns 0 or 1 depending on the bit value.

Method detail


int readBit();
Reads a single bit from the bit stream and returns 0 or 1 depending on the bit value. If the stream is exhausted, -1 is returned. Raises an error if this bit stream has not been properly opened.

Usage:

int bit = stream.readBit();