Code example for IOException

0
    private char[] decoderArray = new char[1024];
     
    // helper for decode 
    private final static void checkByte(int ch, int pos, int len) throws IOException {
        if ((ch & 0xc0) != 0x80)
            throw new IOException(MessageFormat.format("Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}",
                                        new Object[] { new Integer(pos), new Integer(len), new Integer(ch) }));
    }     
 
    private final static void checkMinimal(int ch, int minValue) throws IOException {
        if (ch >= minValue)
            return; 
 
        int actualLen;
        switch (minValue) {
        case MIN_2_BYTES:
            actualLen = 2;
            break; 
        case MIN_3_BYTES:
            actualLen = 3;
            break;