how to choose java nio vs io?

前端 未结 7 1434
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 07:12

As we had known, If we want to use traditional IO to construct server, it must block somewhere, so we had to use loop or one thread one socket mode, So nio seem it is better

相关标签:
7条回答
  • 2020-12-24 08:02

    Some advantages of the NIO.2 API over the legacy java.io.File class for working with files:

    • Supports file system–dependent attributes.
    • Allows you to traverse a directory tree directly.
    • Supports symbolic links.

    For specific use cases and more details, you can see this article

    0 讨论(0)
提交回复
热议问题