Add support for primitive arrays and NIO buffers