32 -> std::expected<std::size_t, std::string>
34 if (not input_file.is_open())
36 return std::unexpected(fmt::format(
"The input file {} is not open!",
input_filename_));
47 input_file.read(size_buffer.data(),
static_cast<int64_t
>(size_buffer.size()));
48 auto serialize_to = zpp::bits::in{ size_buffer, zpp::bits::endian::big{} };
49 serialize_to(size).or_throw();
50 binary_data.resize(size, 0);
51 auto read_size =
static_cast<std::size_t
>(input_file.read(binary_data.data(), size).gcount());
53 if (read_size != size)
55 spdlog::warn(
"Binary Data is not extracted correctly from the input file");