if (offset >= end)
throw new EOFException("unexpected end of file in utf8 character");
int ch2 = buf[offset++] & 0xff;
if ((ch2 & 0xc0) != 0x80)
throw new CharConversionException("illegal utf8 encoding");
_cb.append((char) (((ch1 & 0x1f) << 6) + (ch2 & 0x3f)));
}
else if ((ch1 & 0xf0) == 0xe0) {
if (offset + 1 >= end)
throw new EOFException("unexpected end of file in utf8 character");
int ch2 = buf[offset++] & 0xff;
int ch3 = buf[offset++] & 0xff;
if ((ch2 & 0xc0) != 0x80)
throw new CharConversionException("illegal utf8 encoding");
if ((ch3 & 0xc0) != 0x80)
throw new CharConversionException("illegal utf8 encoding");
_cb.append((char) (((ch1 & 0x1f) << 12) + ((ch2 & 0x3f) << 6) + (ch3 & 0x3f)));
}
else
throw new CharConversionException("illegal utf8 encoding at (" +
(int) ch1 + ")");
}
}