A small zero-dependency Java library for bit-level I/O, with retro-translated artifacts for legacy JVMs.
bit-io reads and writes values that are not aligned to octet boundaries, such as a 1-bit boolean, a 6-bit
unsigned int, or a 47-bit signed long.
final BitOutput output = new DefaultBitOutput(new StreamByteOutput(out));
output.writeBoolean(true);
output.writeInt(true, 6, 42);
output.writeLong(false, 47, -1L);
output.align(1);<dependency>
<groupId>io.github.jinahya</groupId>
<artifactId>bit-io</artifactId>
<version>${bit-io.version}</version>
</dependency>Use the Maven Central page for the latest released version.
Retro-translated artifacts are also published for legacy JVMs:
<dependency>
<groupId>io.github.jinahya</groupId>
<artifactId>bit-io</artifactId>
<version>${bit-io.version}</version>
<classifier>retrotranslated13</classifier>
</dependency><dependency>
<groupId>io.github.jinahya</groupId>
<artifactId>bit-io</artifactId>
<version>${bit-io.version}</version>
<classifier>retrotranslated14</classifier>
</dependency>Guides, examples, and design notes are maintained in the GitHub wiki.
API reference: javadoc.io/doc/io.github.jinahya/bit-io
- Runtime target: Java 1.6.
- Retro-translated artifacts are published with
retrotranslated13andretrotranslated14classifiers. - License: Apache License 2.0.