/** * Closes resources. * * @throws IOException * If an I/O error occurs */ @Override public void close() throws IOException { reader.close(); } }
/** * Returns the current line number * * @return the current line number */ long getCurrentLineNumber() { return reader.getCurrentLineNumber(); }
int c; while (true) { c = reader.read(); token.content.append((char) c).append((char) reader.getLastChar()); } else { token.content.append((char) unescaped); if (isQuoteChar(reader.lookAhead())) { c = reader.read(); token.content.append((char) c); } else { c = reader.read(); if (isDelimiter(c)) { token.type = TOKEN;
/** * Greedily accepts \n, \r and \r\n This checker consumes silently the second control-character... * * @return true if the given or next character is a line-terminator */ boolean readEndOfLine(int ch) throws IOException { // check if we have \r\n... if (ch == CR && reader.lookAhead() == LF) { // note: does not change ch outside of this method! ch = reader.read(); // Save the EOL state if (firstEol == null) { this.firstEol = Constants.CRLF; } } // save EOL state here. if (firstEol == null) { if (ch == LF) { this.firstEol = LF_STRING; } else if (ch == CR) { this.firstEol = CR_STRING; } } return ch == LF || ch == CR; }
final int unescaped = readEscape(); if (unescaped == END_OF_STREAM) { // unexpected char after escape token.content.append((char) ch).append((char) reader.getLastChar()); } else { token.content.append((char) unescaped); ch = reader.read(); // continue } else { token.content.append((char) ch); ch = reader.read(); // continue
int lastChar = reader.getLastChar(); int c = reader.read(); c = reader.read(); eol = readEndOfLine(c); final String line = reader.readLine(); if (line == null) { token.type = EOF; c = reader.read(); eol = readEndOfLine(c);
boolean isClosed() { return reader.isClosed(); }
/** * Returns the current character position * * @return the current character position */ long getCharacterPosition() { return reader.getPosition(); }
this.lexer = new Lexer(format, new ExtendedBufferedReader(reader)); this.csvRecordIterator = new CSVRecordIterator(); this.headerMap = this.initializeHeader();
final int ch = reader.read(); switch (ch) { case 'r':
int lastChar = reader.getLastChar(); int c = reader.read(); c = reader.read(); eol = readEndOfLine(c); final String line = reader.readLine(); if (line == null) { token.type = EOF; c = reader.read(); eol = readEndOfLine(c);
/** * Greedily accepts \n, \r and \r\n This checker consumes silently the second control-character... * * @return true if the given or next character is a line-terminator */ boolean readEndOfLine(int ch) throws IOException { // check if we have \r\n... if (ch == CR && reader.lookAhead() == LF) { // note: does not change ch outside of this method! ch = reader.read(); } return ch == LF || ch == CR; }
final int unescaped = readEscape(); if (unescaped == END_OF_STREAM) { // unexpected char after escape token.content.append((char) ch).append((char) reader.getLastChar()); } else { token.content.append((char) unescaped); ch = reader.read(); // continue } else { token.content.append((char) ch); ch = reader.read(); // continue
boolean isClosed() { return reader.isClosed(); }
/** * Returns the current character position * * @return the current character position */ long getCharacterPosition() { return reader.getPosition(); }
this.lexer = new Lexer(format, new ExtendedBufferedReader(reader)); this.headerMap = this.initializeHeader(); this.characterOffset = characterOffset;
final int ch = reader.read(); switch (ch) { case 'r':
int c; while (true) { c = reader.read(); token.content.append((char) c).append((char) reader.getLastChar()); } else { token.content.append((char) unescaped); if (isQuoteChar(reader.lookAhead())) { c = reader.read(); token.content.append((char) c); } else { c = reader.read(); if (isDelimiter(c)) { token.type = TOKEN;
int lastChar = reader.getLastChar(); int c = reader.read(); c = reader.read(); eol = readEndOfLine(c); final String line = reader.readLine(); if (line == null) { token.type = EOF; c = reader.read(); eol = readEndOfLine(c);
/** * Greedily accepts \n, \r and \r\n This checker consumes silently the second control-character... * * @return true if the given or next character is a line-terminator */ boolean readEndOfLine(int ch) throws IOException { // check if we have \r\n... if (ch == CR && reader.lookAhead() == LF) { // note: does not change ch outside of this method! ch = reader.read(); // Save the EOL state if (firstEol == null) { this.firstEol = Constants.CRLF; } } // save EOL state here. if (firstEol == null) { if (ch == LF) { this.firstEol = LF_STRING; } else if (ch == CR) { this.firstEol = CR_STRING; } } return ch == LF || ch == CR; }