目录

因为input/ouput是对称的,故只介绍其一

字节流

效率对比

  * FileOutputStream:write()一滴一滴的倒
    * FileOutputStream dos = new FileOutputStream("file_path")
  * DataOutputStream:writeXxx()一瓢一瓢的倒
    * DataOutputStream dos = new DataOutputStream(new FileOutputStream("file_path"))
  * BufferedOutputStream:write()先一瓢一瓢倒到一个桶里,再从桶里倒到缸里
    * BufferedOutputStream dos = new BufferedOutputStream(new FileOutputStream("file_path"))

字符流