Skip to content

Add helper function for chunked reads #5

Open
@sosthene-nitrokey

Description

@sosthene-nitrokey

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions