100101102103104105106107108109110
} } h = b = buf.length(); if (b > 0) buf.append((char)delimiter); while (h < chars.length) { ci.position(0); i = -1; m = Integer.MAX_VALUE; while(ci.hasNext()) { i = ci.next(); if (i >= n && i < m) m = i;
111112113114115116117118119120121
} if (m - n > (Integer.MAX_VALUE - delta) / (h + 1)) throw new IOException("Overflow"); delta += (m-n) * (h+1); n = m; ci.position(0); i = -1; while (ci.hasNext()) { i = ci.next(); if (i < n) { if (++delta == 0) throw new IOException("Overflow");
126127128129130131132133134135136
if (q < t) break; buf.append((char)encode_digit(t+(q-t)%(base-t),false)); q = (q-t) / (base-t); } buf.append((char)encode_digit( q, (case_flags!=null)?case_flags[ci.position()-1]:false)); bias = adapt(delta,h+1,h==b); delta=0; ++h; } }