protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
            int b,c;
            int[][] lookup = CHAR_TO_BYTE; // getfield bytecode optimization
            int[] table;
            int remaining = in.remaining();
            while (remaining-- > 0) {
                if (out.remaining() < 1)
                    return CoderResult.OVERFLOW; // we need exactly one byte per char
                c = in.get();
                table = lookup[c >>> 8];
                b =  table == null ? -1 : table[c & 0xFF];
                if (b == -1) {
                    in.position(in.position() - 1);
                    return CoderResult.unmappableForLength(1);
                }
                out.put((byte)(b & 0xFF));
            }
            return CoderResult.UNDERFLOW;
        }