Changed to accept ByteBuffers