I have a ArrayOfByte
Log.d(TAG, "arrayOfByte :"+arrayOfByte); // it will display arrayOfByte :[B@2b052c60
Log.d(TAG, "arrayOfByte :"+ Arrays.toString(arrayOfByte)); //it displays arrayOfByte :[1,1,2,1,3,3,3,2,0,0,0,0,0,0,0]
now i want this [1,1,2,1,3,3,3,2,0,0,0,0,0,0,0]
into some int[ ] series
ie:
int[ ] series ={1,1,2,1,3,3,3,2,0,0,0,0,0,0,0}
So how this can be done??
I used
int[]intArray = new int[1024];
intArray = ByteBuffer.wrap(arrayOfByte).asIntBuffer().array()
but getting exception as below:
04-24 11:32:34.750: E/AndroidRuntime(4927): FATAL EXCEPTION: Thread-10
04-24 11:32:34.750: E/AndroidRuntime(4927): java.lang.UnsupportedOperationException
04-24 11:32:34.750: E/AndroidRuntime(4927): at java.nio.IntToByteBufferAdapter.protectedArray(IntToByteBufferAdapter.java:169)
04-24 11:32:34.750: E/AndroidRuntime(4927): at java.nio.IntBuffer.array(IntBuffer.java:109)