Fix incorrect usage of checkFromIndexSize
This commit is contained in:
parent
0340381357
commit
e1afbee071
@ -4,7 +4,7 @@ kotlin.code.style=official
|
||||
specifyKotlinAsDependency=false
|
||||
|
||||
projectGroup=ru.dbotthepony.kommons
|
||||
projectVersion=2.9.20
|
||||
projectVersion=2.9.21
|
||||
|
||||
guavaDepVersion=33.0.0
|
||||
gsonDepVersion=2.8.9
|
||||
|
@ -75,7 +75,7 @@ public final class XXHash32 extends MessageDigest {
|
||||
|
||||
@Override
|
||||
protected void engineUpdate(byte[] input, int offset, int len) {
|
||||
Objects.checkFromIndexSize(offset, input.length, len);
|
||||
Objects.checkFromIndexSize(offset, len, input.length);
|
||||
if (len == 0) return;
|
||||
|
||||
length += len;
|
||||
|
@ -90,7 +90,7 @@ public final class XXHash64 extends MessageDigest {
|
||||
|
||||
@Override
|
||||
protected void engineUpdate(byte[] input, int offset, int len) {
|
||||
Objects.checkFromIndexSize(offset, input.length, len);
|
||||
Objects.checkFromIndexSize(offset, len, input.length);
|
||||
if (len == 0) return;
|
||||
|
||||
length += len;
|
||||
|
@ -323,7 +323,7 @@ fun OutputStream.writeByteArray(value: ByteArray) {
|
||||
* Writes array's size as variable length integer and then writes its contents
|
||||
*/
|
||||
fun OutputStream.writeByteArray(value: ByteArray, offset: Int, length: Int) {
|
||||
Objects.checkFromIndexSize(offset, value.size, length)
|
||||
Objects.checkFromIndexSize(offset, length, value.size)
|
||||
writeVarInt(length)
|
||||
write(value, offset, length)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user