The O'Reilly book on the subject |
When they ask a whole set of questions and problems started to come to mind. What happens with the Garbage Collect, how fast is the code, does it mess packets.
So I had a little look around for some information on Java NIO, it seems to have been kicking butt since Java 1.4 and we have all ignored it.
Indeed for Java 7 it has a new friend … java.NIO.2.
I promised to do some research so here are my results:
- This article seems to contain the best information: http://www.javaworld.com/article/2078654/java-se/java-se-five-ways-to-maximize-java-nio-and-nio-2.html, its concise and clear.
- To get to grips with Socket IO this article http://www.javaworld.com/article/2853780/java-app-dev/socket-programming-for-scalable-systems.html is also very nice (and by coincidence on the same site).
- If you really wish to dealve deep into the details then this old article from Sept 2001, gives all the nitty-gritty http://www.javaworld.com/article/2075575/core-java/core-java-master-merlin-s-new-i-o-classes.html
- · And then there is the ubiquitous entry from O’Reilly on high performance servers (http://archive.oreilly.com/pub/a/onjava/2004/09/01/nio.html)
- In the docs for Files.copy (http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html) was an example of downloading an html page to a file.
It’s very clean and also means I no longer need to depend on an external jar to perform many file operations.
In fact if you look at the Channels package (http://docs.oracle.com/javase/7/docs/api/java/nio/channels/Channels.html) it will allow you to convert to your familiar Stream classes while still sending data via the nio classes to your socket (AsynchronousSocketChannel).
And if we really-really want to know how to do this stuff:
NIO.2 Cookbook - http://www.javaworld.com/article/2882984/core-java/nio2-cookbook-part-1.html
I may never use Java.IO again!
And if we really-really want to know how to do this stuff:
NIO.2 Cookbook - http://www.javaworld.com/article/2882984/core-java/nio2-cookbook-part-1.html
I may never use Java.IO again!
No comments:
Post a Comment