public String readLine() throws IOException {

        StringBuffer line = new StringBuffer();
        char ch = read();
        try {
            while (ch != '\n' && ch != '\r') {
                if (hasComments) {
                    if (ch == lineComment) {
                        skipComments(ch);
                        break;
                    }
                    if (ch == startComment) {
                        skipComments(ch);
                        ch = read();
                    }
                }
                line.append(ch);
                ch = read();
            }

            // accommodate DOS line endings..
            if (ch == '\r') {
                if (next() == '\n') read();
            }
            lastDelimiter = ch;

        } catch (EOFException e) {
            // We catch an EOF and return the line we have so far
//            encounteredEndOfFile();
        }

        return line.toString();
    }