Learning Java IO and NIO
The major differences between Java IO and NIO
What
is Java IO?
Java
IO stands for Input/Output and it is the API within Java that allows for the reading
and writing of data.
It
is a part of the java.io package.
What
is Java NIO?
Java
NIO (Non-blocking IO) was introduced from Java version 1.4.
The
following table explores the differences between Java IO and NIO.
Java
IO |
Java
NIO |
It is stream oriented
|
It is buffer oriented
|
Blocking
IO -
When
the read() or write() is invoked by a thread, it is blocked until the data is
completely read or written |
Non-blocking
IO
|
There are no selectors |
There are selectors
|
References
JavaTPoint,
n.d. Java IO vs. NIO. [Online]
Available at: https://www.javatpoint.com/java-nio-vs-input-output
Jenkov, J., 2014. Java NIO vs. IO. [Online]
Available at: http://tutorials.jenkov.com/java-nio/nio-vs-io.html
Comments
Post a Comment