Fixed issue where flush would write more bits than cached

This commit is contained in:
Collin Smith
2020-09-02 18:03:15 -07:00
parent 4ccce1dabf
commit 63e3cc0e8b

View File

@ -58,7 +58,7 @@ public class BitOutput {
assert bitsCached >= 0 : "bitsCached(" + bitsCached + ") < " + 0;
assert bitsCached < Byte.SIZE : "bitsCached(" + bitsCached + ") > " + (Byte.SIZE - 1);
if (bitsCached <= 0) return this;
byteOutput._write8(cache);
byteOutput._write8(cache & MASKS[bitsCached]);
clearCache();
return this;
}