diff --git a/core/src/com/riiablo/io/BitConstraints.java b/core/src/com/riiablo/io/BitConstraints.java index c24b74ef..f134a08c 100644 --- a/core/src/com/riiablo/io/BitConstraints.java +++ b/core/src/com/riiablo/io/BitConstraints.java @@ -56,11 +56,6 @@ class BitConstraints { return validateSize(Long.SIZE, bits); } - public static boolean isUnsigned(long value, int size) { - assert 0 < size && size <= Long.SIZE; - return (value & (1 << (size - 1))) == 0; - } - public static int validateAscii(int bits) { return _validateSize(Byte.SIZE - 1, Byte.SIZE, bits); } diff --git a/core/src/com/riiablo/io/BitInput.java b/core/src/com/riiablo/io/BitInput.java index 76980c32..d2772a01 100644 --- a/core/src/com/riiablo/io/BitInput.java +++ b/core/src/com/riiablo/io/BitInput.java @@ -304,7 +304,7 @@ public class BitInput { public byte read7u(int bits) { BitConstraints.validate7u(bits); final byte value = (byte) readUnsigned(bits); - assert BitConstraints.isUnsigned(value, Byte.SIZE); + assert BitUtils.isUnsigned(value); return value; } @@ -315,7 +315,7 @@ public class BitInput { public short read15u(int bits) { BitConstraints.validate15u(bits); final short value = (short) readUnsigned(bits); - assert BitConstraints.isUnsigned(value, Short.SIZE); + assert BitUtils.isUnsigned(value); return value; } @@ -326,7 +326,7 @@ public class BitInput { public int read31u(int bits) { BitConstraints.validate31u(bits); final int value = (int) readUnsigned(bits); - assert BitConstraints.isUnsigned(value, Integer.SIZE); + assert BitUtils.isUnsigned(value); return value; } @@ -337,7 +337,7 @@ public class BitInput { public long read63u(int bits) { BitConstraints.validate63u(bits); final long value = (long) readUnsigned(bits); - assert BitConstraints.isUnsigned(value, Long.SIZE); + assert BitUtils.isUnsigned(value); return value; }