to_bytes is not very efficient (it makes one necessary copy and one unnecessary copy), but it will simplify a lot of use cases. read_from_memory should be maximally efficient for most input types (including mmap).
52 KiB
52 KiB