Function ordering

This commit is contained in:
Collin Smith 2020-07-28 04:38:36 -07:00
parent 148a8e108e
commit fa2594048c

View File

@ -135,31 +135,11 @@ public class BitStream {
return value;
}
public long read64BitsOrLess(int bits) {
assert bits <= Long.SIZE;
return readUnsigned(bits);
}
public int read32BitsOrLess(int bits) {
assert bits <= Integer.SIZE;
return (int) readUnsigned(bits);
}
public short read16BitsOrLess(int bits) {
assert bits <= Short.SIZE;
return (short) readUnsigned(bits);
}
public byte readUnsigned7OrLess(int bits) {
assert bits <= Byte.SIZE - 1;
return (byte) readUnsigned(bits);
}
public int readUnsigned8OrLess(int bits) {
assert bits <= Byte.SIZE;
return (int) readUnsigned(bits);
}
public short readUnsigned15OrLess(int bits) {
assert bits <= Short.SIZE - 1;
return (short) readUnsigned(bits);
@ -170,6 +150,26 @@ public class BitStream {
return (int) readUnsigned(bits);
}
public int readUnsigned8OrLess(int bits) {
assert bits <= Byte.SIZE;
return (int) readUnsigned(bits);
}
public short read16BitsOrLess(int bits) {
assert bits <= Short.SIZE;
return (short) readUnsigned(bits);
}
public int read32BitsOrLess(int bits) {
assert bits <= Integer.SIZE;
return (int) readUnsigned(bits);
}
public long read64BitsOrLess(int bits) {
assert bits <= Long.SIZE;
return readUnsigned(bits);
}
public int readSigned(int bits) {
int shift = Integer.SIZE - bits;
return ((int) readUnsigned(bits)) << shift >> shift;