public int read() throws IOException {
  int val;
  if ((val=is.read()) < 0) {
    return -1;
  }
switch (val & 0xf0) {
case 0xc0:
case 0xd0:
    val=((val & 0x1f) << 6) | (is.read() & 0x3f);
  break;
case 0xe0:
val=((val & 0x0f) << 12) | ((is.read() & 0x3f) << 6) | (is.read() & 0x3f);
break;
case 0xf0:
throw new UnsupportedEncodingException();
default :
break;
}
return val;
}

public int read ( ) throws IOException { int val ; if ( ( val = is . read ( ) ) < 0 ) { return - 1 ; } switch ( val & 0xf0 ) { case 0xc0 : case 0xd0 : val = ( ( val & 0x1f ) << 6 ) | ( is . read ( ) & 0x3f ) ; break ; case 0xe0 : val = ( ( val & 0x0f ) << 12 ) | ( ( is . read ( ) & 0x3f ) << 6 ) | ( is . read ( ) & 0x3f ) ; break ; case 0xf0 : throw new UnsupportedEncodingException ( ) ; default : break ; } return val ; }
reads a single character .
