Count lines in a file (With BufferedInputStream) in Scala.

```
   object CountLinesScala {

  def main(args: Array[String]) {
    val c = countLines("C:/.../Motifs/mrr569.fasta")
    println(c)
  }

  def countLines(filename: String): Int = {
    val is = new BufferedInputStream(new FileInputStream(filename))
    try {
      val c = Array.ofDim[Byte](1024)
      var count = 0
      var readChars = 0
      var empty = true
      while ((readChars = is.read(c)) != -1) {
        empty = false
        for (i <- 0 until readChars if c(i) == '\n') {
          count=count +1
        }
      }
      if ((count == 0 && !empty)) 1 else count
    } finally {
      is.close()
    }
  }
}

```

its not working, Why ?
i click run but there is no reaction, and no Errors !