Hi All,
I have read one tutorial on New IO package of
Java. It says that Java NIO is faster than the old IO API. I have tried to find the difference between them using below programs
file.txt has about 30000 lines. When I run Main.java. I am getting below results
Time taken by NIOReader is 7 seconds
Time taken by IOReader is almost 0 seconds
I thought may be its caching the file somewhere so I tried running both of them individually as well. But I am getting the same result. I beleive I am doing something wrong here. Can
ant one suggest me what is wrong or if I have misunderstood the whole concept.