Compare Direct and Non-Direct ByteBuffer get/put operations
Is get/put from a non-direct bytebuffer faster than get/put from direct bytebuffer ? If I have to read / write from direct bytebuffer , is it better to first read /write in to a thread local byte array and then update ( for writes ) the direct bytebuffer fully with the byte array ? Is get/put from a non-direct bytebuffer faster than get/put from direct bytebuffer ? If you are comparing heap buffer with direct buffer which does not use native byte order (most systems are little endian and the default for direct ByteBuffer is big endian), the performance is very similar. If you use native