mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-13 12:26:28 +07:00
Created util function to retrieve safe u32s
This commit is contained in:
parent
1116e14fc7
commit
d1af110c12
@ -24,4 +24,13 @@ public class BitUtils {
|
||||
public static boolean isUnsigned(long value) {
|
||||
return isUnsigned(value, Long.SIZE);
|
||||
}
|
||||
|
||||
public static int[] readSafe32u(ByteInput in, int len) {
|
||||
return readSafe32u(in, new int[len], 0, len);
|
||||
}
|
||||
|
||||
public static int[] readSafe32u(final ByteInput in, final int[] dst, final int offset, final int len) {
|
||||
for (int i = offset; i < len; i++) dst[i] = in.readSafe32u();
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user