Skip to content

Commit cbfea68

Browse files
LucasCholletgmta
authored andcommitted
AK: Add BigEndianInputBitStream::bits_until_next_byte_boundary()
1 parent 9ae17e3 commit cbfea68

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

AK/BitStream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class BigEndianInputBitStream : public Stream {
111111

112112
/// Whether we are (accidentally or intentionally) at a byte boundary right now.
113113
ALWAYS_INLINE bool is_aligned_to_byte_boundary() const { return m_bit_offset % 8 == 0; }
114+
ALWAYS_INLINE u8 bits_until_next_byte_boundary() const { return m_bit_offset % 8 == 0 ? 0 : 8 - m_bit_offset; }
114115

115116
private:
116117
Optional<u8> m_current_byte;

0 commit comments

Comments
 (0)