Implement sync sockets, pipes on JVM using NIO.