public long Decode(BitStream32 stream, BitStreamCtx ctx)
{
long min = 0;
long check;
int galloping = 1;
while (true) {
check = (1L << galloping) - 1L;
if (stream.Read (ctx)) {
min = check + 1L;
++galloping;
} else {
if (min == 0L) {
return this.SecondCoding.Decode (stream, 2, ctx);
} else {
return min + this.SecondCoding.Decode (stream, min, ctx);
}
}
}
}