I just read ...
Classes that work with streams are located in two packages: java.io and java.nio. Classes from the former implement blocking of input/
Consider a situation where you have 2 threads. Both threads are reading from single socket streams. Here we are concerned about the source bytes which we are reading as well as we need to check in terms of Multi-threading
. The reason is due to Blocking I/O
Blocking I/O: This is I/O which waits indefinitely for availability of source. The execution of thread waits at that point and it increases chances of Hang
or Slowness
of your application. java.io
package is example of this type
Non-Blocking I/O: This is I/O which will not wait for source for infinite time, but will return immediately. java.nio
package is example of this type