write(011₂) // We do not write anything to the file, yet. Instead we will store the state in the // BitWriter as follows: // .current_byte will be 011₀₀₀₀₀ // .num_bits_left will be 5 write(1010₂) // We do not write to the file yet. // BitWriter tracks that: // .current_byte will be 0111010₀ // .num_bits_left will be 1. write(111₂) // .current_byte gets completed with the first bit (1). // .current_byte is (temporarily) 01110101₂. // We write that byte to the file and reset .current_byte to 00000000₂ // BitWriter now tracks that: // .current_byte is 11₀₀₀₀₀₀ // .num_bits_left will be 6.