You are fortunate that byte "completely stripped" to short , so:
// Grab size of the byte array, create an array of shorts of the same size int size = byteArray.length; short[] shortArray = new short[size]; for (int index = 0; index < size; index++) shortArray[index] = (short) byteArray[index];
And then use shortArray .
Note. As for the primitive type, Java always processes them in a large order, so converting, say, the ff byte will reduce 00ff .
source share