{"id":34289929,"url":"https://github.com/jinahya/bit-io","last_synced_at":"2026-04-05T01:33:19.141Z","repository":{"id":57720534,"uuid":"13432998","full_name":"jinahya/bit-io","owner":"jinahya","description":"A library for reading/writing arbitrary length of bits.","archived":false,"fork":false,"pushed_at":"2023-12-05T22:18:03.000Z","size":32157,"stargazers_count":35,"open_issues_count":2,"forks_count":10,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-12-20T13:58:55.397Z","etag":null,"topics":["bit","io","java"],"latest_commit_sha":null,"homepage":"","language":"Java","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/jinahya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["jinahya"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":"bit-iog","liberapay":"jinahya","issuehunt":"jinahya","otechie":null,"custom":null}},"created_at":"2013-10-09T04:26:39.000Z","updated_at":"2025-12-04T06:47:29.000Z","dependencies_parsed_at":"2022-09-26T21:40:58.452Z","dependency_job_id":null,"html_url":"https://github.com/jinahya/bit-io","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/jinahya/bit-io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinahya%2Fbit-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinahya%2Fbit-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinahya%2Fbit-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinahya%2Fbit-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinahya","download_url":"https://codeload.github.com/jinahya/bit-io/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinahya%2Fbit-io/sbom","scorecard":{"id":521082,"data":{"date":"2025-08-11","repo":{"name":"github.com/jinahya/bit-io","commit":"2fd0f13baf523d03e8ac0aeadf4afe269a3c0fed"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/maven.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":4,"reason":"binaries present in source code","details":["Warn: binary detected: ext/retrotranslated13/backport-util-concurrent-java12-3.1.jar:1","Warn: binary detected: ext/retrotranslated13/jdk1.3.1_28.rt.jar:1","Warn: binary detected: ext/retrotranslated13/retrotranslator-runtime13-1.2.9.jar:1","Warn: binary detected: ext/retrotranslated14/backport-util-concurrent-3.1.jar:1","Warn: binary detected: ext/retrotranslated14/jdk1.4.2_19.rt.jar:1","Warn: binary detected: ext/retrotranslated14/retrotranslator-runtime-1.2.9.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.3.5 not signed: https://api.github.com/repos/jinahya/bit-io/releases/4347107","Warn: release artifact 1.3.5 does not have provenance: https://api.github.com/repos/jinahya/bit-io/releases/4347107"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'develop'","Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/jinahya/bit-io/maven.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/jinahya/bit-io/maven.yml/develop?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T03:01:10.192Z","repository_id":57720534,"created_at":"2025-08-20T03:01:10.193Z","updated_at":"2025-08-20T03:01:10.193Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31421869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","io","java"],"created_at":"2025-12-17T02:03:28.756Z","updated_at":"2026-04-05T01:33:19.132Z","avatar_url":"https://github.com/jinahya.png","language":"Java","funding_links":["https://github.com/sponsors/jinahya","https://funding.communitybridge.org/projects/bit-iog","https://liberapay.com/jinahya","https://issuehunt.io/r/jinahya","https://www.paypal.com/cgi-bin/webscr?cmd=_cart\u0026business=A954LDFBW4B9N\u0026lc=KR\u0026item_name=GitHub\u0026amount=5%2e00\u0026currency_code=USD\u0026button_subtype=products\u0026add=1\u0026bn=PP%2dShopCartBF%3adonate%2dpaypal%2dblue%2epng%3aNonHosted"],"categories":[],"sub_categories":[],"readme":"# bit-io\n\n[![GitHub Action](https://github.com/jinahya/bit-io/workflows/Java%20CI/badge.svg)](https://github.com/jinahya/bit-io/actions?workflow=Java+CI)\n[![CircleCI](https://circleci.com/gh/jinahya/bit-io/tree/develop.svg?style=svg)](https://circleci.com/gh/jinahya/bit-io/tree/develop)\n[![Build Status](https://travis-ci.org/jinahya/bit-io.svg?branch=develop)](https://travis-ci.org/jinahya/bit-io)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.github.jinahya%3Abit-io%3Adevelop\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=com.github.jinahya%3Abit-io%3Adevelop)\n[![Known Vulnerabilities](https://snyk.io//test/github/jinahya/bit-io/badge.svg?targetFile=pom.xml)](https://snyk.io//test/github/jinahya/bit-io?targetFile=pom.xml)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.jinahya/bit-io.svg)](https://img.shields.io/maven-central/v/com.github.jinahya/bit-io)\n[![javadoc](https://javadoc.io/badge2/com.github.jinahya/bit-io/javadoc.svg)](https://javadoc.io/doc/com.github.jinahya/bit-io)\n\nA library for reading/writing non octet aligned values such as `1-bit boolean` or `17-bit unsigned int`.\n\nSee [bit-io2](https://github.com/jinahya/bit-io2) for Java8+ flavored version.\n\n## Specifications\n\n#### boolean\n\n|type     |size(min)|size(max)|notes                                   |\n|---------|---------|---------|----------------------------------------|\n|`boolean`|1        |1        |`readBoolean()`, `writeBoolean(boolean)`|\n\n### numeric\n\n#### integral\n\nThe size(min) is `1` and the size(max) is `2^e - (unsigned ? 1 : 0)`.\n\n|type   |e  |size(min)|size(max)|notes                                                           |\n|-------|---|---------|---------|----------------------------------------------------------------|\n|`byte` |3  |1        |7/8      |`readByte(unsigned, size)`, `writeByte(unsigned, size, byte)`   |\n|`short`|4  |1        |15/16    |`readShort(unsigned, size)`, `writeShort(unsigned, size, short)`|\n|`int`  |5  |1        |31/32    |`readInt(unsigned, size)`, `writeInt(unsigned, size, int)`      |\n|`long` |6  |1        |63/64    |`readLong(unsigned, size)`, `writeLong(unsigned, size, long)`   |\n|`char` |   |1        |16       |`readChar(size)`, `writeChar(size, char)`                       |\n\n#### floating-point\n\nNo methods supplied for floating-point types.\n\n## Reading\n\n* You need to prepare an instance of `ByteInput` for reading octets.\n* You can read bits from an instance of `BitInput` which uses the `ByteInput` instance.\n\n### Preparing `ByteInput`\n\nPrepare an instance of `ByteInput` from various sources.\n\n````java\nnew ArrayByteInput(byte[], int);\nnew BufferByteInput(java.nio.ByteBuffer);\nnew DataByteInput(java.io.DataInput);\nnew StreamByteInput(java.io.InputStream);\n````\n\n### Creating `BitInput`\n\n#### Using `DefaultBitInput`\n\nConstruct with an already existing `ByteInput`.\n\n```java\nfinal BitInput bitInput = new DefalutBitInput(byteInput);\n```\n\n### Reading values.\n\n```java\nfinal BitInput input;\n\nfinal boolean b = input.readBoolean();        // 1-bit boolean        1    1\nfinal int ui6 = input.readInt(true, 6);       // 6-bit unsigned int   6    7\nfinal long sl47 = input.readLong(false, 47);  // 47-bit signed long  47   54\n\nfinal long discarded = input.align(1);        // aligns to (1*8)-bit  2   56\nassert discarded == 2L;\n```\n\n```\nb        llllllll llllllll llllllll llllllll llllllll llllll\n iiiiiil                                                    dd\n```\n\n## Writing\n\n* You need to prepare an instance of `ByteOutput` for writing octets.\n* You can write bits to an instance of `BitInput` which uses the `ByteOutput` instance.\n\n### Preparing `ByteOutput`\n\nThere are counter classes and contructors to `ByteInput`.\n\n### Creating `BitOutput`\n\nThere are also counter classes and constructors to `BitInput`.\n\n#### Using `DefalutBitOutput`\n\n### Writing values.\n\n```java\nfinal BitOutput output;\n\noutput.writeBoolean(false);           // 1-bit boolean          1    1\noutput.writeInt(false, 9, -72);       // 9-bit signed int       9   10\noutput.writeBoolean(true);            // 1-bit boolean          1   11\noutput.writeLong(true, 33, 99L);      // 33-bit unsigned long  33   44\n\nfinal long padded = output.align(4);  // aligns to (4*8)-bit   20   64\nassert padded == 20L;\n```\n\n```\nb          b                                     pppp pppppppp pppppppp\n iiiiiii ii lllll llllllll llllllll llllllll llll\n01101110 00100000 00000000 00000000 00000110 00110000 00000000 00000000\n```\n\n----\n[![Domate via Paypal](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_cart\u0026business=A954LDFBW4B9N\u0026lc=KR\u0026item_name=GitHub\u0026amount=5%2e00\u0026currency_code=USD\u0026button_subtype=products\u0026add=1\u0026bn=PP%2dShopCartBF%3adonate%2dpaypal%2dblue%2epng%3aNonHosted)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinahya%2Fbit-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinahya%2Fbit-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinahya%2Fbit-io/lists"}