What is the exact use of java nio package when already methods are available with io package

前端 未结 5 1195
清歌不尽
清歌不尽 2020-12-12 20:43

I was learning java nio package and I realized there are lots of methods already provided by File which nio.Files is providing again by using Path class. Like that few more

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 21:29

    The main difference between IO and NIO is that IO is blocking, while NIO is non-blocking.

    This article explains the differences in the packages and what blocking and non-blocking IO is. archived

提交回复
热议问题