diff --git a/include/etl/bit_stream.h b/include/etl/bit_stream.h index 23b82dbf..6475ce3e 100644 --- a/include/etl/bit_stream.h +++ b/include/etl/bit_stream.h @@ -1198,13 +1198,21 @@ namespace etl } //*************************************************************************** - /// Returns the number of bytes used in the stream. + /// Returns the number of bytes in the stream buffer. //*************************************************************************** size_t size_bytes() const { return length_chars; } + //*************************************************************************** + /// Returns the number of bits in the stream buffer. + //*************************************************************************** + size_t size_bits() const + { + return length_chars * CHAR_BIT; + } + //*************************************************************************** /// Returns start of the stream. //***************************************************************************