From f7a38d5e15642959bdf4e22753317cbd9eb06126 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 8 Aug 2020 14:18:33 -0700 Subject: [PATCH] Documented ByteInput#bitInput(BitInput) invariants --- core/src/com/riiablo/io/nio/ByteInput.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/com/riiablo/io/nio/ByteInput.java b/core/src/com/riiablo/io/nio/ByteInput.java index 66597255..027aa4bb 100644 --- a/core/src/com/riiablo/io/nio/ByteInput.java +++ b/core/src/com/riiablo/io/nio/ByteInput.java @@ -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. + * Precondition: {@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 + ")";