public override int Read()
{
int ch0 = bStrm.ReadByte();
int ch1;
int ch2;
if (ch0 < 0x7f)
{
delta = (ch0 == EOF ? 0 : 1);
return ch0;
}
else if ((ch0 & 0xe0) == 0xc0)
{
delta = 2;
ch1 = bStrm.ReadByte();
if ((ch1 & 0xc0) == 0x80)
return ((ch0 & 0x1f) << 6) + (ch1 & 0x3f);
else
throw BadUTF8();
}
else if ((ch0 & 0xf0) == 0xe0)
{
delta = 3;
ch1 = bStrm.ReadByte();
ch2 = bStrm.ReadByte();
if ((ch1 & ch2 & 0xc0) == 0x80)
return ((ch0 & 0xf) << 12) + ((ch1 & 0x3f) << 6) + (ch2 & 0x3f);
else
throw BadUTF8();
}
else
throw BadUTF8();
}