Package com.reve.utils.shortarray
Class ShortArrayUtil
java.lang.Object
com.reve.utils.shortarray.ShortArrayUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intconvertByteToShort(byte[] input, int offset, int inputLen, short[] output, int outOffset) Convert the given input byte array into short array.static intconvertShortToByte(short[] input, int offset, int inputLen, byte[] output, int outOffset) Convert the given input short array into byte array.
-
Constructor Details
-
ShortArrayUtil
public ShortArrayUtil()
-
-
Method Details
-
convertByteToShort
public static int convertByteToShort(byte[] input, int offset, int inputLen, short[] output, int outOffset) Convert the given input byte array into short array. And populate to given output short array. This method uses Big-Endian format to convert the array.- Parameters:
input- Byte array to be convertedoffset- starting index of input byte array.inputLen- length of input byte arrayoutput- Short array where converted data will be saved.outOffset- starting index of output short array.- Returns:
- the length of converted short array.
-
convertShortToByte
public static int convertShortToByte(short[] input, int offset, int inputLen, byte[] output, int outOffset) Convert the given input short array into byte array. And populate to given output byte array. This method uses Big-Endian format to convert the array.- Parameters:
input- Short array to be converted.offset- starting index of input short array.inputLen- length of input short array.output- byte array where converted data will be saved.outOffset- starting index of output byte array.- Returns:
- the length of converted byte array.
-