mcrl2::utilities::ibitstream

Include file:

#include "mcrl2/utilities/bitstream.h
class mcrl2::utilities::ibitstream

The counterpart of obitstream, guarantees that the same data is read as has been written when calling the read operators in the same sequence as the corresponding write operators.

Private attributes

unsigned int mcrl2::utilities::ibitstream::bits_in_buffer

how many bits in the buffer are used.

std::vector<char> mcrl2::utilities::ibitstream::m_text_buffer

A temporary buffer to store char array strings.

std::bitset<128> mcrl2::utilities::ibitstream::read_buffer

Buffer that is filled starting from bit 127 when reading.

std::istream &mcrl2::utilities::ibitstream::stream

Public member functions

ibitstream(std::istream &stream)

Provides the stream on which the read function operate.

std::size_t read_bits(unsigned int num_of_bits)

Reads an num_of_bits bits from the input stream and stores them in the least significant part (in descending order) of the return value.

Parameters:

  • num_of_bits Number of bits to read from the input stream.

std::size_t read_integer()

Returns: A natural number that was read from the binary stream encoded in most significant bit encoding.

const char *read_string()

Returns: A pointer to the read string.

Remains valid until the next call to read_string.

Private member functions

void read(std::size_t size, std::uint8_t *buffer)

Read size bytes into the provided buffer.