support direct buffer (direct buffer does not allow array() call)