当io包中已有方法时,java nio包的确切用法是什么 [英] What is the exact use of java nio package when already methods are available with io package
问题描述
我正在学习java nio包,我意识到文件已经提供了很多方法,nio.Files再次使用Path类提供这些方法。就像我得到的那样。
我实际上并没有得到nio包的实际用途。
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 I got. I am actually not getting what is the actual use of nio package.
我对这个包很新,所以可能我的问题是错的,但是很少的帮助可以促使我进一步阅读。
I am just very new to this package so may be my question is wrong but a little help can boost me to read further.
推荐答案
IO和NIO之间的主要区别在于IO是阻塞的,而NIO是非阻塞。
The main difference between IO and NIO is that IO is blocking, while NIO is non-blocking.
本文解释了包中的差异以及阻塞和非阻塞IO的含义。
This article explains the differences in the packages and what blocking and non-blocking IO is.
这篇关于当io包中已有方法时,java nio包的确切用法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!