public void skipToEndOfLine() throws IOException {

        char ch;

        do {
            ch = read();
            if (hasComments) {
                if (ch == lineComment) {
                    skipComments(ch);
                    break;
                }
                if (ch == startComment) {
                    skipComments(ch);
                    ch = read();
                }
            }

        } while (ch != '\n' && ch != '\r');

        if (ch == '\r') {
            if (nextCharacter() == '\n') read();
        }
    }