com.sap.hana.datalake.files.utils.ArrayUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sap-hdlfs Show documentation
Show all versions of sap-hdlfs Show documentation
An implementation of org.apache.hadoop.fs.FileSystem targeting SAP HANA Data Lake Files.
// © 2023 SAP SE or an SAP affiliate company. All rights reserved.
package com.sap.hana.datalake.files.utils;
import com.sap.hana.datalake.files.classification.InterfaceAudience;
@InterfaceAudience.Private
public class ArrayUtils {
public static void validateBoundaries(final byte[] data, final int offset, final int length) throws IndexOutOfBoundsException {
if (data == null) {
throw new NullPointerException("data cannot be null");
} else if (offset < 0 || length < 0 || offset + length > data.length) {
throw new IndexOutOfBoundsException(String.format("Invalid arguments: data(length=%d), offset=%d, length=%d", data.length, offset, length));
}
}
}
// © 2023 SAP SE or an SAP affiliate company. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy