Top "Nio" questions

NIO is Java 'New I/O' introduced in 1.4, providing non-blocking and multiplexed network I/O; 'direct' (native) buffers; file locks and mapped files; and character set codecs.

Deep copy duplicate() of Java's ByteBuffer

java.nio.ByteBuffer#duplicate() returns a new byte buffer that shares the old buffer's content. Changes to the old buffer's …

java nio deep-copy bytebuffer
Using Java nio to create a subdirectory and file

I'm creating a simple program that will try to read in "conf/conf.xml" from disk, but if this file …

java file nio
How to use NIO to write InputStream to File?

I am using following way to write InputStream to File: private void writeToFile(InputStream stream) throws IOException { String filePath = "C:\\…

java image file inputstream nio
Java 7 WatchService - Ignoring multiple occurrences of the same event

The javadoc for StandardWatchEventKinds.ENTRY_MODIFY says: Directory entry modified. When a directory is registered for this event then the …

java file nio watchservice
Get file/directory size using Java 7 new IO

How can I get the size of a file or directory using the new NIO in java 7?

nio java-7
Java Large Files Disk IO Performance

I have two (2GB each) files on my harddisk and want to compare them with each other: Copying the original …

java performance comparison stream nio
Why are we getting ClosedByInterruptException from FileChannel.map in Java 1.6?

A customer of ours complains that, sporadically, calls of ours to FileChannel.map fail with a ClosedByInterruptException. The Javadoc does …

java nio jdk1.6
Java thread per connection model vs NIO

Is the non-blocking Java NIO still slower than your standard thread per connection asynchronous socket? In addition, if you were …

java multithreading asynchronous nio nonblocking
Create a ByteBuf in Netty 4.0

Two simple questions, which I am not able to solve by reading the documentation: I have a byte[] How can …

java netty nio
Java NIO - Memory mapped files

I recently came across this article which provided a nice intro to memory mapped files and how it can be …

java buffer nio channel memory-mapped-files