{"id":17914201,"url":"https://github.com/knadh/chunkedreader","last_synced_at":"2025-08-15T08:33:21.577Z","repository":{"id":28979697,"uuid":"32506192","full_name":"knadh/chunkedreader","owner":"knadh","description":"chunkedreader is a light weight wrapper for Go's `bufio` that enables reading of byte streams in fixed size chunks","archived":false,"fork":false,"pushed_at":"2015-03-19T09:11:47.000Z","size":120,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T19:59:34.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knadh.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}},"created_at":"2015-03-19T07:07:26.000Z","updated_at":"2024-01-02T03:59:11.000Z","dependencies_parsed_at":"2022-09-26T17:50:17.082Z","dependency_job_id":null,"html_url":"https://github.com/knadh/chunkedreader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fchunkedreader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fchunkedreader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fchunkedreader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Fchunkedreader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knadh","download_url":"https://codeload.github.com/knadh/chunkedreader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229903297,"owners_count":18142032,"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":[],"created_at":"2024-10-28T19:56:48.884Z","updated_at":"2024-12-16T03:24:27.016Z","avatar_url":"https://github.com/knadh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go chunkedreader\n\nKailash Nadh, March 2015\n\nMIT License\n\n## What?\nchunkedreader is a light weight wrapper for Go's `bufio` that enables reading of byte streams in fixed size chunks.\n\nIt makes use of `bufio.Scanner`'s custom split function capability, which otherwise is meant for splitting\nbased on delimiters, to split based on fixed lengths.\n\nThis could especially be useful for reading continuous fixed length messages from a TCP stream, emulating \"packets\", for instance.\n\n## Installation (go 1.1+)\n`go get github.com/knadh/chunkedreader`\n\n## Example\n```go\npackage main\n\nimport (\n\t\"github.com/knadh/chunkedreader\"\n)\n\nfunc main() {\n\t// Open file for reading.\n\tf, _ := os.Open(\"test.txt\")\n\n\t// Initialize the reader to read chunks of 4 bytes.\n\tch := chunkedreader.New(f, 4)\n\n\tfor ch.Read() {\n\t\t// Length of b will always be 4, or less than 4 if there\n\t\t// are no more bytes available to read.\n\t\tb := ch.Bytes()\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknadh%2Fchunkedreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknadh%2Fchunkedreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknadh%2Fchunkedreader/lists"}