added the option to us Heap or Direct byte buffers.