From 2433fac1fe00688bf85c3c8ad8085a006512c944 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Mon, 10 Aug 2020 18:33:40 -0700 Subject: [PATCH] Implemented writeBoolean(boolean) and write1(int) methods to write a single bit --- core/src/com/riiablo/io/BitOutput.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/com/riiablo/io/BitOutput.java b/core/src/com/riiablo/io/BitOutput.java index 0f19f63e..85d91034 100644 --- a/core/src/com/riiablo/io/BitOutput.java +++ b/core/src/com/riiablo/io/BitOutput.java @@ -138,6 +138,15 @@ public class BitOutput { 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) { BitConstraints.validate8(bits); _writeSigned(value, bits);