当前位置:网站首页>Scala IO reads binary files

Scala IO reads binary files

2022-06-24 23:38:00 Jue Niu thunder plough hot blade

import java.io.{
    File, FileInputStream}

object D05_ Read binary  {
    

  def main(args: Array[String]): Unit = {
    
    val file = new File("./data/4.png")
    val fis = new FileInputStream(file)
    // val buf = new Array[Byte](file.length().toInt) //  Writing at work 
    val buf = new Array[Byte](888888)
    val len = fis.read(buf)
    println(" Number of valid bytes read :" + len)
    println(" The length of the byte array :" + buf.length)
  }

}

4.png
4.png
4.png Location
4.png Location

原网站

版权声明
本文为[Jue Niu thunder plough hot blade]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211118166405.html