Standard I/O (java.io) is stream-oriented and BLOCKING—one thread per connection. NIO (New I/O, java.nio) is buffer-oriented and NON-BLOCKING, using 'Selectors' and 'Channels' to handle thousands of connections with just a few threads. NIO enables high-performance servers (Netty, Tomcat).
Standard I/O: Each customer has a dedicated cashier (blocking). NIO: One cashier serves many customers, switching quickly between them (non-blocking).
When should you choose NIO over standard I/O? What are the trade-offs?