| 24 | } |
| 25 | |
| 26 | void write_i64_file(const std::filesystem::path & path, const std::vector<int64_t> & values) { |
| 27 | std::ofstream out(path, std::ios::binary); |
| 28 | if (!out) { |
| 29 | throw std::runtime_error("failed to open output file: " + path.string()); |
| 30 | } |
| 31 | out.write(reinterpret_cast<const char *>(values.data()), static_cast<std::streamsize>(values.size() * sizeof(int64_t))); |
| 32 | if (!out) { |
| 33 | throw std::runtime_error("failed to write output file: " + path.string()); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | } // namespace |
| 38 |