{"id":16805630,"url":"https://github.com/gcarq/seek_bufread","last_synced_at":"2025-10-08T02:38:05.838Z","repository":{"id":57666540,"uuid":"71590209","full_name":"gcarq/seek_bufread","owner":"gcarq","description":"A drop-in replacement for std::io::BufReader with seeking support.","archived":false,"fork":false,"pushed_at":"2023-05-29T14:59:37.000Z","size":602,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T21:53:20.688Z","etag":null,"topics":["buffer","library","reader","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gcarq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-21T19:16:51.000Z","updated_at":"2024-01-25T09:10:58.000Z","dependencies_parsed_at":"2024-10-13T09:48:53.793Z","dependency_job_id":"100f9027-b0a1-4f02-a1e5-b5fcfacfff30","html_url":"https://github.com/gcarq/seek_bufread","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":0.1428571428571429,"last_synced_commit":"1ff6dff6e449cff969e94bb77aacb89de20cc4ac"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcarq%2Fseek_bufread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcarq%2Fseek_bufread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcarq%2Fseek_bufread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcarq%2Fseek_bufread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcarq","download_url":"https://codeload.github.com/gcarq/seek_bufread/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898103,"owners_count":20528331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buffer","library","reader","rust"],"created_at":"2024-10-13T09:48:51.031Z","updated_at":"2025-10-08T02:38:00.803Z","avatar_url":"https://github.com/gcarq.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seek_bufread\n\n[![Build Status](https://travis-ci.org/gcarq/seek_bufread.svg?branch=master)](https://travis-ci.org/gcarq/seek_bufread) [![Coverage Status](https://coveralls.io/repos/github/gcarq/seek_bufread/badge.svg?branch=master)](https://coveralls.io/github/gcarq/seek_bufread?branch=master) [![Crates.io](https://img.shields.io/crates/v/seek_bufread.svg)](https://crates.io/crates/seek_bufread/)\n\n**24.04.2019 NOTE:** This library is no longer needed since BufReader provides [seek_relative()](https://doc.rust-lang.org/std/io/struct.BufReader.html#method.seek_relative) with the same functionality. (See [rust#31100](https://github.com/rust-lang/rust/issues/31100)).\n\n\nA drop-in replacement for `std::io::BufReader` with seeking support.\n\n[Full Documentation](https://gcarq.github.io/seek_bufread)\n\n## Quick Example\n\n```rust\nuse std::io::{self, Cursor, Read, Seek, SeekFrom};\nuse seek_bufread::BufReader;\n\nlet inner = Cursor::new([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\nlet mut reader = BufReader::new(inner);\n\nreader.seek(SeekFrom::Current(4)).unwrap();\nlet mut buf = [0; 8];\n\n// read bytes from internal buffer\nreader.read(\u0026mut buf).unwrap();\nassert_eq!(buf, [4, 5, 6, 7, 8, 9, 10, 11]);\n```\n\n## Usage\n\nPut this in your `Cargo.toml`:\n\n```toml\n[dependencies]\nseek_bufread = \"~1.2\"\n```\n\nAnd this in your crate root:\n\n```rust\nextern crate seek_bufread;\n```\n\n## Benchmarks\n\nTests with the suffix `_std` are using the standard `std::io::BufRead`\nimplementation. The Overall performance without seek operations is\nquite similar between both. With seek operations ``seek_bufread::BufRead``\nis significantly faster.\n\n```\ntest tests::read_10mb_default_from_cursor        ... bench:   6,044,915 ns/iter (+/- 275,518)\ntest tests::read_10mb_default_from_cursor_std    ... bench:   6,038,466 ns/iter (+/- 227,145)\ntest tests::read_10mb_default_from_file          ... bench:   4,213,179 ns/iter (+/- 116,043)\ntest tests::read_10mb_default_from_file_std      ... bench:   4,224,658 ns/iter (+/- 132,629)\ntest tests::read_10mb_fullbuf_from_file          ... bench:   7,280,470 ns/iter (+/- 209,827)\ntest tests::read_10mb_fullbuf_from_file_std      ... bench:   7,448,666 ns/iter (+/- 2,720,199)\ntest tests::read_10mb_halfbuf_from_file          ... bench:   5,962,017 ns/iter (+/- 415,952)\ntest tests::read_10mb_halfbuf_from_file_std      ... bench:   5,904,902 ns/iter (+/- 240,471)\ntest tests::read_seek_10mb_default_from_file     ... bench:       6,621 ns/iter (+/- 145)\ntest tests::read_seek_10mb_default_from_file_std ... bench:      59,651 ns/iter (+/- 1,993)\ntest tests::read_seek_10mb_halfbuf_from_file     ... bench:   1,168,511 ns/iter (+/- 63,956)\ntest tests::read_seek_10mb_halfbuf_from_file_std ... bench:  62,872,335 ns/iter (+/- 5,344,766)\n```\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcarq%2Fseek_bufread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcarq%2Fseek_bufread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcarq%2Fseek_bufread/lists"}