Skip to content

Random access to files #231

Open
Open
@LewsTherinTelescope

Description

Multiplatform Sources and Sinks are already great features, but it would also be nice to have random-access capabilities like Okio's FileHandle class. The BufferView option discussed in #225 would help in some cases, but in other cases it's impractical to load the entire file into memory to get at a small part of it—reading a few individual files from an archive, for example. As far as I know the only way to do this right now is to create a new Source and skip to the specified offset, which isn't particularly convenient. (In fact, if I'm reading the code correctly, the skip function does read everything up until that point into a buffer temporarily? Which would make it a no-go for those usecases as well.)

(I've tried to search both the repo and Slack to make sure there wasn't existing discussion about this, but if I've missed something please point me to it!)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions