public int ReadZeros(BitStreamCtx ctx)
{
int c = 0;
while (ctx.Offset < this.N) {
int numbits = (int)Math.Min (32, this.N - ctx.Offset);
uint u = 0;
u = (uint)this.Read (numbits, ctx);
if (u == 0x0) {
c += numbits;
continue;
}
int pos = BitAccess.Select1 (u, 1);
ctx.Offset -= numbits - pos;
c += pos;
break;
}
return c;
}