All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.hana.datalake.files.utils.ArrayUtils Maven / Gradle / Ivy

Go to download

An implementation of org.apache.hadoop.fs.FileSystem targeting SAP HANA Data Lake Files.

There is a newer version: 3.0.27
Show newest version
// © 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