Open rocallahan opened 2 weeks ago
An even better API (for Python) would be to accept a Python io.BufferedIOBase
which we would wrap in a tl::InputStreamBase
but that's far more work.
Thanks for this PR. This makes sense.
Version will be 0.29.9 - if you like, I can change that.
Basically, the reader can take data from "data:
For symmetry, a writer to bytes would be needed too, right?
Matthias
Another comment: Currently, passing the byte array as std::vector<char>
involves a memory copy. So this facility is not good for passing huge files.
This is much more convenient and a bit more efficient than writing the bytes to a temporary file and reading that back in. It's useful when we have received a layout over the network or embedded in some file.
This makes a copy of the bytes but there doesn't seem to be any way to avoid that currently.