Documented ByteInput#bitInput(BitInput) invariants

This commit is contained in:
Collin Smith 2020-08-08 14:18:33 -07:00
parent 75ac29d698
commit f7a38d5e15

View File

@ -34,6 +34,11 @@ public class ByteInput {
return bitInput != null ? bitInput : (bitInput = new BitInput(this));
}
/**
* Assigns the bit stream of this byte stream to the specified bit stream.
* <b>Precondition:</b> {@link #bitInput} is {@code null} and
* {@link BitInput#byteInput()} is {@code this}.
*/
BitInput bitInput(BitInput bitInput) {
assert this.bitInput == null : "this.bitInput(" + this.bitInput + ") != null";
assert bitInput.byteInput() == this : "bitInput.byteInput()(" + bitInput.byteInput() + ") != this(" + this + ")";