Code example for IOException

    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)
        int actualLen;
        switch (minValue) {
        case MIN_2_BYTES:
            actualLen = 2;
        case MIN_3_BYTES:
            actualLen = 3;
Experience pair programming with AI  Get Codota for Java