how to choose java nio vs io?

前端 未结 7 1435
没有蜡笔的小新
没有蜡笔的小新 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 07:44

    Traditional IO is easy and simplified code, NIO is more complicated but more flexible. In my case i prefer use IO for small streaming and NIO for large streaming but nio is really more complex

    with NIO i have to create an entire package to manage it instead io package that i directly use snippet

提交回复
热议问题