@Test public void success_JoinByteArray_1() { byte[] input1 = new byte[]{1, 2, 3, 4, 5}; byte[] input2 = new byte[]{6, 7, 8, 9, 10}; byte[] result = ByteUtils.join(input1, input2); assertThat(result, is(new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})); }
public static byte[] join(byte[] value1, byte[] value2) { int length = value1.length + value2.length; byte[] result = new byte[length]; System.arraycopy(value1, 0, result, 0, value1.length); System.arraycopy(value2, 0, result, value1.length, value2.length); return result; }
ByteUtils { public static byte[] join(byte[] value1, byte[] value2) { int length = value1.length + value2.length; byte[] result = new byte[length]; System.arraycopy(value1, 0, result, 0, value1.length); System.arraycopy(value2, 0, result, value1.length, value2.length); return result; } }
ByteUtils { public static byte[] join(byte[] value1, byte[] value2) { int length = value1.length + value2.length; byte[] result = new byte[length]; System.arraycopy(value1, 0, result, 0, value1.length); System.arraycopy(value2, 0, result, value1.length, value2.length); return result; }  }
ByteUtils { public static byte[] join(byte[] value1, byte[] value2) { int length = value1.length + value2.length; byte[] result = new byte[length]; System.arraycopy(value1, 0, result, 0, value1.length); System.arraycopy(value2, 0, result, value1.length, value2.length); return result; }  static byte[][] split(byte[] input, int firstLength); static byte[] reverse(byte[] input); static byte[] join(byte[] value1, byte[] value2); static byte[] join(byte[]... inputs); static byte[] paddingZeroOnHead(byte[] input, int byteLength); static byte[] paddingZeroOnTail(byte[] input, int byteLength); static int readBit(byte value, int position); }
ByteUtils { public static byte[] join(byte[] value1, byte[] value2) { int length = value1.length + value2.length; byte[] result = new byte[length]; System.arraycopy(value1, 0, result, 0, value1.length); System.arraycopy(value2, 0, result, value1.length, value2.length); return result; }  static byte[][] split(byte[] input, int firstLength); static byte[] reverse(byte[] input); static byte[] join(byte[] value1, byte[] value2); static byte[] join(byte[]... inputs); static byte[] paddingZeroOnHead(byte[] input, int byteLength); static byte[] paddingZeroOnTail(byte[] input, int byteLength); static int readBit(byte value, int position);  }