Use `buf_as_slice` in `Bitmap`