ArrayConverters { public static int[] combineIntegers(int[] twoByteIntArray, int[] fourByteIntArray) { int[] outArray = new int[twoByteIntArray.length+fourByteIntArray.length/2]; int outIndex=0; int twoByteIndex=0; for (int fourByteIndex=0; fourByteIndex<fourByteIntArray.length; fourByteIndex+=2){ outArray[outIndex] = fourByteIntArray[fourByteIndex]; outIndex++; for(int i=0; i<fourByteIntArray[fourByteIndex+1]; i++){ outArray[outIndex] = twoByteIntArray[twoByteIndex]; outIndex++; twoByteIndex++; } } return outArray; }  static String[] decodeChainList(byte[] currentChainList, int length); static float[] convertIntsToFloats(int[] intArray, float floatDivider); static int[] convertByteToIntegers(byte[] byteArray); static int[] convertTwoByteToIntegers(byte[] byteArray); static short[] convertTwoBytesToShorts(byte[] byteArray); static int[] convertFourByteToIntegers(byte[] byteArray); static int[] combineIntegers(int[] twoByteIntArray, int[] fourByteIntArray); static char[] convertIntegerToChar(int[] integerArray); static byte[] convertIntegersToBytes(int[] intArray); static byte[] convertIntegersToTwoBytes(int[] intArray); static byte[] convertShortsToTwoBytes(short[] shortArray); static byte[] convertIntegersToFourByte(int[] intArray); static int[] convertFloatsToInts(float[] floatArray, float floatMultiplier); static List<int[]> splitIntegers(int[] inputArray); static int[] convertCharToIntegers(char[] charArray); static byte[] encodeChainList(String[] chainNames, int length); static int[] recursiveIndexEncode(int[] in); static int[] recursiveIndexDecode(int[] in);  }
@Test public final void combineArraysTest() { int[] twoByteIntArray = {1,2,5,4,50,0}; int[] fourByteIntArray = {10002,4,1002,2}; int[] testCombinedArray = {10002,1,2,5,4,1002,50,0}; int[] combinedArray = ArrayConverters.combineIntegers(twoByteIntArray, fourByteIntArray); assertArrayEquals(testCombinedArray, combinedArray); }