Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
def count=0, MAXSIZE=100
new File("groovyfoo.battxt").withReader { reader ->
  while (reader.readLine() != null) {
    if (++count > MAXSIZE) throw new RuntimeException('File too large') 
  }
}

...