Class RainbowUtil


  • public class RainbowUtil
    extends java.lang.Object
    This class is needed for the conversions while encoding and decoding, as well as for comparison between arrays of some dimensions
    • Constructor Summary

      Constructors 
      Constructor Description
      RainbowUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static short[] convertArray​(byte[] in)
      This function converts an one-dimensional array of bytes into a one-dimensional array of type short
      static short[][] convertArray​(byte[][] in)
      This function converts a matrix of bytes into a matrix of type short
      static short[][][] convertArray​(byte[][][] in)
      This function converts a 3-dimensional array of bytes into a 3-dimensional array of type short
      static byte[] convertArray​(short[] in)
      This function converts an array of type short into an array of type byte
      static byte[][] convertArray​(short[][] in)
      This function converts a matrix of type short into a matrix of type byte
      static byte[][][] convertArray​(short[][][] in)
      This function converts a 3-dimensional array of type short into a 3-dimensional array of type byte
      static int[] convertArraytoInt​(byte[] in)
      This function converts an one-dimensional array of bytes into a one-dimensional array of int
      static byte[] convertIntArray​(int[] in)
      This function converts an array of type int into an array of type byte
      static boolean equals​(short[][][] left, short[][][] right)
      Compare two three-dimensional short arrays.
      static boolean equals​(short[][] left, short[][] right)
      Compare two two-dimensional short arrays.
      static boolean equals​(short[] left, short[] right)
      Compare two short arrays.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RainbowUtil

        public RainbowUtil()
    • Method Detail

      • convertArraytoInt

        public static int[] convertArraytoInt​(byte[] in)
        This function converts an one-dimensional array of bytes into a one-dimensional array of int
        Parameters:
        in - the array to be converted
        Returns:
        out the one-dimensional int-array that corresponds the input
      • convertArray

        public static short[] convertArray​(byte[] in)
        This function converts an one-dimensional array of bytes into a one-dimensional array of type short
        Parameters:
        in - the array to be converted
        Returns:
        out one-dimensional short-array that corresponds the input
      • convertArray

        public static short[][] convertArray​(byte[][] in)
        This function converts a matrix of bytes into a matrix of type short
        Parameters:
        in - the matrix to be converted
        Returns:
        out short-matrix that corresponds the input
      • convertArray

        public static short[][][] convertArray​(byte[][][] in)
        This function converts a 3-dimensional array of bytes into a 3-dimensional array of type short
        Parameters:
        in - the array to be converted
        Returns:
        out short-array that corresponds the input
      • convertIntArray

        public static byte[] convertIntArray​(int[] in)
        This function converts an array of type int into an array of type byte
        Parameters:
        in - the array to be converted
        Returns:
        out the byte-array that corresponds the input
      • convertArray

        public static byte[] convertArray​(short[] in)
        This function converts an array of type short into an array of type byte
        Parameters:
        in - the array to be converted
        Returns:
        out the byte-array that corresponds the input
      • convertArray

        public static byte[][] convertArray​(short[][] in)
        This function converts a matrix of type short into a matrix of type byte
        Parameters:
        in - the matrix to be converted
        Returns:
        out the byte-matrix that corresponds the input
      • convertArray

        public static byte[][][] convertArray​(short[][][] in)
        This function converts a 3-dimensional array of type short into a 3-dimensional array of type byte
        Parameters:
        in - the array to be converted
        Returns:
        out the byte-array that corresponds the input
      • equals

        public static boolean equals​(short[] left,
                                     short[] right)
        Compare two short arrays. No null checks are performed.
        Parameters:
        left - the first short array
        right - the second short array
        Returns:
        the result of the comparison
      • equals

        public static boolean equals​(short[][] left,
                                     short[][] right)
        Compare two two-dimensional short arrays. No null checks are performed.
        Parameters:
        left - the first short array
        right - the second short array
        Returns:
        the result of the comparison
      • equals

        public static boolean equals​(short[][][] left,
                                     short[][][] right)
        Compare two three-dimensional short arrays. No null checks are performed.
        Parameters:
        left - the first short array
        right - the second short array
        Returns:
        the result of the comparison