Fixed bug where readSafe64u was reading 32u

This commit is contained in:
Collin Smith 2020-08-18 01:41:46 -07:00
parent 00caad594c
commit 7667cfdff2

View File

@ -426,13 +426,13 @@ public class ByteInput {
*
* @throws UnsafeNarrowing if the read value is larger than 63 bits.
*
* @see #read32u()
* @see #read64()
*/
public long readSafe64u() {
assert aligned() : "not aligned";
try {
final long value = read32u(); // increments bits
return BitConstraints.safe32u(value);
final long value = read64(); // increments bits
return BitConstraints.safe64u(value);
} catch (IndexOutOfBoundsException t) {
throw new EndOfInput(t);
}