I have an int[] in java which i want to convert to a byte[].
Now the usual way to do this would be to create a new byte[] 4 times the size of the int array and copy all the ints byte by byte into the new byte array.
However the only reason to do this is because of java's type safety rules. An int array is already a byte array. Its just that java doesnt allow casting an int[] to a byte[] and then using it as a byte[].
Is there any way, maybe using jni, to make an int array look like a byte array to java ?