private String[] parseLine(String nextLine,boolean multi) throws IOException {
  if (!multi && pending != null) {
    pending=null;
  }
  if (nextLine == null) {
    if (pending != null) {
      String s=pending;
      pending=null;
      return new String[]{s};
    }
 else {
      return null;
    }
  }
  List<String> tokensOnThisLine=new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
  StringBuilder sb=new StringBuilder(INITIAL_READ_SIZE);
  boolean inQuotes=false;
  if (pending != null) {
    sb.append(pending);
    pending=null;
    inQuotes=!this.ignoreQuotations;
  }
  inQuotes=checkForQuotes(nextLine,tokensOnThisLine,sb,inQuotes);
  if ((inQuotes && !ignoreQuotations)) {
    if (multi) {
      sb.append('\n');
      charCountInsideQuote=sb.length() - (sb.indexOf("\"") + 1);
      if (charCountInsideQuote >= 10000) {
        throw new IOException("Un-terminated quoted field after 10000 characters");
      }
      pending=sb.toString();
      sb=null;
    }
 else {
      throw new IOException("Un-terminated quoted field at end of CSV line");
    }
  }
 else {
    inField=false;
    charCountInsideQuote=0;
  }
  if (sb != null) {
    tokensOnThisLine.add(sb.toString());
  }
  return tokensOnThisLine.toArray(new String[tokensOnThisLine.size()]);
}

private String [ ] parseLine ( String nextLine , boolean multi ) throws IOException { if ( ! multi && pending != null ) { pending = null ; } if ( nextLine == null ) { if ( pending != null ) { String s = pending ; pending = null ; return new String [ ] { s } ; } else { return null ; } } List < String > tokensOnThisLine = new ArrayList < > ( CarbonCommonConstants . DEFAULT_COLLECTION_SIZE ) ; StringBuilder sb = new StringBuilder ( INITIAL_READ_SIZE ) ; boolean inQuotes = false ; if ( pending != null ) { sb . append ( pending ) ; pending = null ; inQuotes = ! this . ignoreQuotations ; } inQuotes = checkForQuotes ( nextLine , tokensOnThisLine , sb , inQuotes ) ; if ( ( inQuotes && ! ignoreQuotations ) ) { if ( multi ) { sb . append ( '\n' ) ; charCountInsideQuote = sb . length ( ) - ( sb . indexOf ( "\"" ) + 1 ) ; if ( charCountInsideQuote >= 10000 ) { throw new IOException ( "Un-terminated quoted field after 10000 characters" ) ; } pending = sb . toString ( ) ; sb = null ; } else { throw new IOException ( "Un-terminated quoted field at end of CSV line" ) ; } } else { inField = false ; charCountInsideQuote = 0 ; } if ( sb != null ) { tokensOnThisLine . add ( sb . toString ( ) ) ; } return tokensOnThisLine . toArray ( new String [ tokensOnThisLine . size ( ) ] ) ; }
parses an incoming string and returns an array of elements .
