code: @Override
  	public int read() throws IOException {
  		if (pos >= limit)
  			return -1;
  
  		try {
  			int c = buf[pos] & 0xff;
  			if (c < 0x80) {
  				pos++;
  			} else if (c < 0xE0) {
  				c = (char) ((c & 0x1F) << 6 | buf[pos + 1] & 0x3F);
  				pos += 2;
  			} else {
  				c = (char) ((c & 0x0F) << 12 | (buf[pos + 1] & 0x3F) << 6 | (buf[pos + 2] & 0x3F));
  				pos += 3;
  			}
  			if (pos > limit)
  				throw new IOException();
  			return c;
  		} catch (ArrayIndexOutOfBoundsException e) {
  			throw new IOException(e);
  		}
  	}
docs: Reads a single character
  
  @return the character read, as an integer
  @throws IOException if an I/O error occurs