You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use flexbuffers::Builder;letmut builder = Builder::default();letmut root = builder.start_map();
root.push("my_ints",&[1i32,2,3,4,5]);
root.end_map();write_to_file(builder.view());
Here, pushing the &[i32] iterates over all integers in the slice, finds the minimal width that's needed to represent all values, converts all values to that size, and writes them as little-endian.
Is there a more efficient way which boils down to a memcpy? My slices are very large and I would like to write them to the destination buffer as fast as possible. I don't mind if the stored representation isn't as compact as it could be.
The text was updated successfully, but these errors were encountered:
Here, pushing the
&[i32]
iterates over all integers in the slice, finds the minimal width that's needed to represent all values, converts all values to that size, and writes them as little-endian.Is there a more efficient way which boils down to a memcpy? My slices are very large and I would like to write them to the destination buffer as fast as possible. I don't mind if the stored representation isn't as compact as it could be.
The text was updated successfully, but these errors were encountered: