boolean consumeQuoted(PushbackReader reader, int quoteCharacter) throws IOException {
            //this currently assumes excel "escaping" of double quotes:
            //'the " quick' -> "the "" quick"
            //we can make this more interesting later with other
            //escaping options
            int c = read(reader);
            while (c != -1) {
                if (c == quoteCharacter) {
                    int nextC = read(reader);
                    if (nextC == EOF) {
                        encapsulated++;
                        endColumn();
                        throw new UnsurprisingEOF();
                    } else if (nextC != quoteCharacter) {
                        encapsulated++;
                        endColumn();
                        unread(reader, nextC);
                        consumeSpaceCharacters(reader);
                        //now make sure that the next character is eof, \r\n
                        //or a delimiter
                        nextC = read(reader);
                        if (nextC == EOF) {
                            throw new UnsurprisingEOF();
                        } else if (nextC == NEW_LINE || nextC == CARRIAGE_RETURN) {
                            unread(reader, nextC);
                            return true;
                        } else if (nextC != delimiter) {
                            unread(reader, nextC);
                            return false;
                        }
                        unread(reader, nextC);
                        return true;
                    }
                }
                c = read(reader);
            }
            throw new EOFException();
        }
@param reader
@param quoteCharacter
@return whether or not this was a correctly encapsulated cell
@throws UnsurprisingEOF if the file ended immediately after the close quote
@throws EOFException    if the file ended in the middle of the encapsulated section
@throws IOException     on other IOExceptions
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/csv/CSVSniffer.java