I can find tons of examples but they seem to either rely mostly on Java libraries or just read characters/lines/etc.
I just want to read in some file and get a byte
I have used below code to read a CSV file.
import scala.io.StdIn.readLine
import scala.io.Source.fromFile
readFile("C:/users/xxxx/Downloads/", "39025968_ccccc_1009.csv")
def readFile(loc :String,filenm :String): Unit ={
var flnm = fromFile(s"$loc$filenm") // Imported fromFile package
println("Files testing")
/*for (line <- flnm.getLines()) {
printf("%4d %s\n", line.length, line)
}*/
flnm.getLines().foreach(println) // getLines() is imported from readLines.
flnm.close()
}