Implemented writeBoolean(boolean) and write1(int) methods to write a single bit

This commit is contained in:
Collin Smith 2020-08-10 18:33:40 -07:00
parent 4a00f0207f
commit 2433fac1fe

View File

@ -138,6 +138,15 @@ public class BitOutput {
return this; return this;
} }
public BitOutput writeBoolean(boolean b) {
return write1(b ? 1 : 0);
}
public BitOutput write1(int value) {
_writeRaw(value, 1);
return this;
}
public BitOutput write8(int value, int bits) { public BitOutput write8(int value, int bits) {
BitConstraints.validate8(bits); BitConstraints.validate8(bits);
_writeSigned(value, bits); _writeSigned(value, bits);