public void putString(final CharSequence str) throws IOException {
        int pos = getCursorPosition();
        buf.write(str);
        if (mask == null) {
            // no masking
            print(str, pos);
        } else if (mask == NULL_MASK) {
            // don't print anything
        } else {
            rawPrint(mask, str.length());
        }
        drawBuffer();
    }