Skip to content

v0.2.1

Latest

Choose a tag to compare

@yyyoichi yyyoichi released this 20 Nov 06:56

Bug fix

reader := NewBitReader([]uint8{255}, 0, 0)
reader.SetBits(8 + 1)
got := reader.Read8R(8, 1)  // ->> panic!!
func (r *BitReader[T]) SetBits(bits int) {
+	if max := len(r.data) * r.s; bits > max {
+		bits = max
+		return
+	}
	r.bits = bits
}