Class ArrayMeasurementUtils

java.lang.Object
org.github.jamm.utils.ArrayMeasurementUtils

public final class ArrayMeasurementUtils extends Object
Utility methods to measure arrays.
  • Method Details

    • computeArraySize

      public static long computeArraySize(int arrayBaseOffset, int length, int elementSize, int objectAlignment)
      Computes the size of an array from its base offset, length, elementSize and object alignment.
      Parameters:
      arrayBaseOffset - the array base offset
      length - the array length
      elementSize - the size of the array elements
      objectAlignment - the object alignment (padding) in bytes
      Returns:
      the size of the array