only need `const_cast` instead of `reinterpret_cast`. also do `const char* data` instead.