{"id":13823385,"url":"https://github.com/bamiaux/iobit","last_synced_at":"2025-07-08T17:33:34.783Z","repository":{"id":6679487,"uuid":"7924470","full_name":"bamiaux/iobit","owner":"bamiaux","description":"Package iobit provides primitives for reading \u0026 writing bits","archived":false,"fork":false,"pushed_at":"2017-04-18T07:35:05.000Z","size":52,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-05T09:11:54.989Z","etag":null,"topics":["bit","go","reader","writer"],"latest_commit_sha":null,"homepage":"","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/bamiaux.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":"2013-01-30T21:41:35.000Z","updated_at":"2022-10-17T13:30:00.000Z","dependencies_parsed_at":"2022-09-04T00:10:29.045Z","dependency_job_id":null,"html_url":"https://github.com/bamiaux/iobit","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/bamiaux%2Fiobit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamiaux%2Fiobit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamiaux%2Fiobit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamiaux%2Fiobit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bamiaux","download_url":"https://codeload.github.com/bamiaux/iobit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225453325,"owners_count":17476701,"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":["bit","go","reader","writer"],"created_at":"2024-08-04T09:00:32.798Z","updated_at":"2024-11-20T01:30:31.259Z","avatar_url":"https://github.com/bamiaux.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# iobit [![GoDoc](https://godoc.org/github.com/bamiaux/iobit/web?status.png)](https://godoc.org/github.com/bamiaux/iobit) [![Build Status](https://travis-ci.org/bamiaux/iobit.png)](https://travis-ci.org/bamiaux/iobit)\nPackage iobit provides primitives for reading \u0026 writing bits The main purpose of this library is to remove the need to write custom bit-masks when reading or writing bitstreams, and to ease maintenance.\n\nDownload:\n```shell\ngo get github.com/bamiaux/iobit\n```\n\n\nFull documentation at http://godoc.org/github.com/bamiaux/iobit\n\n* * *\nPackage iobit provides primitives for reading \u0026 writing bits\n\nThe main purpose of this library is to remove the need to write\ncustom bit-masks when reading or writing bitstreams, and to ease\nmaintenance. This is true especially when you need to read/write\ndata which is not aligned on bytes.\n\nErrors are sticky so you can check for errors after a chunk of\nmeaningful work rather than after every operation.\n\nFor example, with iobit you can read an MPEG-TS PCR like this:\n\n```\nr := iobit.NewReader(buffer)\nbase := r.Uint64(33)     // PCR base is 33-bits\nr.Skip(6)                // 6-bits are reserved\nextension := r.Uint64(9) // PCR extension is 9-bits\n```\n\ninstead of:\n\n```\nbase  = uint64(buffer[0]) \u003c\u003c 25\nbase |= uint64(buffer[1]) \u003c\u003c 17\nbase |= uint64(buffer[2]) \u003c\u003c 9\nbase |= uint64(buffer[3]) \u003c\u003c 1\nbase |= buffer[4] \u003e\u003e 7\nextension := uint16(buffer[4] \u0026 0x1) \u003c\u003c 8\nextension |= buffer[5]\n```\n\nand write it like this:\n\n```\nw := iobit.NewWriter(buffer)\nw.PutUint64(33, base)\nw.PutUint32(6, 0)\nw.PutUint32(9, extension)\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamiaux%2Fiobit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbamiaux%2Fiobit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamiaux%2Fiobit/lists"}