A read_to_end function in streaming::utils.
I don't want to do a method that takes or return a Bytes<N> because the whole point of the streaming API is for file that are too large and for which we don't want to have large stack allocations.
What I think we may want to have a function that reads a file and insert it to a &mut Vec, but I was not sure which type should be used?
In opcard and PIV we have a Reply wrapper type around Bytes which are themselves a wrapper around heapless::Vec<u8,N>.
Maybe we could have something like read_to_end(path, location, buffer: &mut impl Write) but I'm not sure which Write trait we should use (std::io::Write is not available in core). Maybe we should come up with our own?
A
read_to_endfunction instreaming::utils.I don't want to do a method that takes or return a
Bytes<N>because the whole point of the streaming API is for file that are too large and for which we don't want to have large stack allocations.What I think we may want to have a function that reads a file and insert it to a
&mut Vec, but I was not sure which type should be used?In opcard and PIV we have a
Replywrapper type aroundByteswhich are themselves a wrapper aroundheapless::Vec<u8,N>.Maybe we could have something like
read_to_end(path, location, buffer: &mut impl Write)but I'm not sure which Write trait we should use (std::io::Writeis not available in core). Maybe we should come up with our own?