void put(int number, int length) { for (var i = 0; i < length; i++) { final bit = ((number >> (length - i - 1)) & 1) == 1; putBit(bit); } }