public List<Record> readAllRecords(InputStream ios, int maxLines) throws IOException, NumberFormatException { List<Record> records = new ArrayList<>(); BufferedReader dataIS = new BufferedReader(new InputStreamReader(ios, CDM.utf8Charset)); int count = 0; while ((maxLines < 0) || (count < maxLines)) { String line = dataIS.readLine(); if (line == null) break; if (line.startsWith(comment)) continue; if (line.trim().length() == 0) continue; if (debug) System.out.printf("%s%n", line); Record r = Record.make(line, fields); if (r != null) records.add(r); count++; } return records; }
public Record readRecord(String line) throws IOException, NumberFormatException { if (line == null) return null; if (line.startsWith("#")) return null; if (line.trim().length() == 0) return null; //System.out.printf("%s%n", line); return Record.make(line, fields); }
public List<Record> readAllRecords(InputStream ios, int maxLines) throws IOException, NumberFormatException { List<Record> records = new ArrayList<Record>(); BufferedReader dataIS = new BufferedReader(new InputStreamReader(ios)); int count = 0; while ((maxLines < 0) || (count < maxLines)) { String line = dataIS.readLine(); if (line == null) break; if (line.startsWith("#")) continue; if (line.trim().length() == 0) continue; //System.out.printf("%s%n", line); Record r = Record.make(line, fields); if (r != null) records.add(r); count++; } return records; }
public List<Record> readAllRecords(InputStream ios, int maxLines) throws IOException, NumberFormatException { List<Record> records = new ArrayList<>(); BufferedReader dataIS = new BufferedReader(new InputStreamReader(ios, CDM.utf8Charset)); int count = 0; while ((maxLines < 0) || (count < maxLines)) { String line = dataIS.readLine(); if (line == null) break; if (line.startsWith(comment)) continue; if (line.trim().length() == 0) continue; if (debug) System.out.printf("%s%n", line); Record r = Record.make(line, fields); if (r != null) records.add(r); count++; } return records; }