public boolean read()

in src/main/java/org/apache/datasketches/LineReader.java [60:84]


  public boolean read(final int lines, final ProcessLine processLine) {
    boolean ret = false;
    String line;
    int ctr = 0;
    try {
      while ((line = bufReaderIn.readLine()) != null) {
        lineNo++; // external, file line number, starts with 1
        ctr++;    // internal, used for completion
        if (line.length() == 0) {
          continue;
        }
        // Callback
        processLine.process(line, lineNo);
        ret = true;
        if (lines <= 0) {
          continue;
        } else if (ctr >= lines) {
          break;
        }
      }
    } catch (final IOException e) {
      throw new RuntimeException(e);
    }
    return ret;
  }