Package com.redis.vl.utils
Class ArrayUtils
java.lang.Object
com.redis.vl.utils.ArrayUtils
Utility class for array conversions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic float[]
bytesToFloatArray
(byte[] bytes) Convert byte array to float array using little-endian byte order.static float[]
doubleArrayToFloats
(double[] doubles) Convert double array to float array.static byte[]
floatArrayToBytes
(float[] floats) Convert float array to byte array using little-endian byte order.
-
Method Details
-
floatArrayToBytes
public static byte[] floatArrayToBytes(float[] floats) Convert float array to byte array using little-endian byte order.- Parameters:
floats
- The float array to convert- Returns:
- The byte array representation
-
bytesToFloatArray
public static float[] bytesToFloatArray(byte[] bytes) Convert byte array to float array using little-endian byte order.- Parameters:
bytes
- The byte array to convert- Returns:
- The float array representation
-
doubleArrayToFloats
public static float[] doubleArrayToFloats(double[] doubles) Convert double array to float array.- Parameters:
doubles
- The double array to convert- Returns:
- The float array representation
-