Class ShortArrayUtil

java.lang.Object
com.reve.utils.shortarray.ShortArrayUtil

public class ShortArrayUtil extends Object
  • 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 converted
      offset - starting index of input byte array.
      inputLen - length of input byte array
      output - 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.