public CSVConfig guess(){
  try {
    BufferedReader bIn=new BufferedReader(new InputStreamReader(getInputStream(),StandardCharsets.UTF_8));
    String[] lines=new String[10];
    String line=null;
    int counter=0;
    while ((line=bIn.readLine()) != null && counter <= 10) {
      lines[counter]=line;
      counter++;
    }
    if (counter < 10) {
      String[] newLines=new String[counter];
      System.arraycopy(lines,0,newLines,0,counter);
      lines=newLines;
    }
    analyseLines(lines);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      Exception e) {
      }
    }
  }
  CSVConfig conf=config;
  config=null;
  return conf;
}

public CSVConfig guess ( ) { try { BufferedReader bIn = new BufferedReader ( new InputStreamReader ( getInputStream ( ) , StandardCharsets . UTF_8 ) ) ; String [ ] lines = new String [ 10 ] ; String line = null ; int counter = 0 ; while ( ( line = bIn . readLine ( ) ) != null && counter <= 10 ) { lines [ counter ] = line ; counter ++ ; } if ( counter < 10 ) { String [ ] newLines = new String [ counter ] ; System . arraycopy ( lines , 0 , newLines , 0 , counter ) ; lines = newLines ; } analyseLines ( lines ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( in != null ) { try { in . close ( ) ; } catch ( Exception e ) { } } } CSVConfig conf = config ; config = null ; return conf ; }
guess the config based on the first 10 ( or less when less available ) records of a csv file .
