Skip to content

Add fn skip(n: uint) with a default implementation to Reader #13989

Closed
@carllerche

Description

@carllerche

Reader should have an extra fn that allows skipping a number of bytes. The default implementation could look something like:

fn skip(n: uint) { let _ = self.read(Vec::from_elem(n, 0u8); }

However, BufReader could implement the fn by simply updating the internal cursor. This would allow more efficient skipping w/o having to require Seek.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-mediumMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions