Added support for direct buffers by removing the use of bb.array()