Package org.github.jamm.utils
Class ArrayMeasurementUtils
java.lang.Object
org.github.jamm.utils.ArrayMeasurementUtils
Utility methods to measure arrays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longcomputeArraySize(int arrayBaseOffset, int length, int elementSize, int objectAlignment) Computes the size of an array from its base offset, length, elementSize and object alignment.
-
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 offsetlength- the array lengthelementSize- the size of the array elementsobjectAlignment- the object alignment (padding) in bytes- Returns:
- the size of the array
-