C++ (Qt)qint64 val = 123;assert(ba.data() + sizeof(val) <= ba.size());memmove(ba.data(), &val, sizeof(val));