private String readIACSETerminatedString(int maxlength) throws IOException {
            int where = 0;
            char[] cbuf = new char[maxlength];
            char b = ' ';
            boolean cont = true;

            do {
                int i;
                i = rawread();
                switch (i) {
                    case IAC:
                        i = rawread();
                        if (i == SE) {
                            cont = false;
                        }
                        break;
                    case -1:
                        return (new String("default"));
                    default:
                }
                if (cont) {
                    b = (char) i;
                    // Fix for overflow wimpi (10/06/2004)
                    if ((b == '\n') || (b == '\r') || (where == maxlength)) {
                        cont = false;
                    } else {
                        cbuf[where++] = b;
                    }
                }
            } while (cont);

            return (new String(cbuf, 0, where));
        }// readIACSETerminatedString