count = Math.min(count, buffer.length - offset);
    public void set(int offset, char ch, int count, int color) {        final char v = (char)((ch & 0xFF) | ((color & 0xFF) << 8));        for (int i = 0; i < count; i++) {            buffer[offset+i] = v;        }    }