Can someone with the natural gift to explain complex things in an easy and straightforward way address this question? To acquire the best performance when should I use direc
A direct buffer is best when you are just copying the data, say from a socket to a file or vice versa, as the data doesn't have to traverse the JNI/Java boundary, it just stays in JNI land. If you are planning to look at the data yourself there's no point in a direct buffer.