Fix incorrect usage of checkFromIndexSize

This commit is contained in:
DBotThePony 2024-03-19 11:12:12 +07:00
parent 0340381357
commit e1afbee071
Signed by: DBot
GPG Key ID: DCC23B5715498507
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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)
}