I wanted to implement Java's Scanner in Scala. The goal for this class is to:Implement a Scala collection interface (probably Iterator[String]?) so I can access all the Scala collection goodies like map, .toList etc.Have better performance than java.util.ScannerPlease review my code for bugs/design advice/performance advice:import java.io._import java.util.StringTokenizer/** * Scala implementation of a faster java.util.Scanner * See: http://codeforces.com/blog/entry/7018 */class Scanner(reader: BufferedReader) extends Iterator[String] {  def this(inputStreamReader: InputStreamReader) = this(new BufferedReader(inputStreamReader))  def this(file: File) = this(new FileReader(file))  def this(inputStream: InputStream) = this(new InputStreamReader(inputStream))  def this(str: String) = this(new ByteArrayInputStream(str.getBytes))  private[this] var tokenizer: StringTokenizer = _  private[this] def nextTokenizer() = {    while(tokenizer == null || !tokenizer.hasMoreTokens) tokenizer = new StringTokenizer(reader.readLine())    tokenizer  }  def nextLine() = {    tokenizer = null    reader.readLine()  }  override def hasNext = nextTokenizer().hasMoreTokens  override def next() = nextTokenizer().nextToken()  def nextInt() = next().toInt  def nextLong() = next().toLong  def nextDouble() = next().toDouble}Benchmarks here
Scanner in Scala
scala;io;benchmarking