public function consumeBits(Buffer $buffer, $n)
    {
        $bits = [];
        $value = $buffer->consumeUint8();
        for ($i = 0; $i < $n; ++$i) {
            $bits[] = ($value & (1 << $i)) > 0;
        }
        return $bits;
    }