1. short[] to byte[]
ByteBuffer buffer = ByteBuffer.allocate(shortArray.length * 2);
buffer.order(ByteOrder.LITTLE_ENDIAN);buffer.asShortBuffer().put(shortArray);
byte[] bytes = buffer.array();
2. byte[] to short[]
byte[] bytes ;
short[] shorts;
ByteBuffer.wrap(bytes ).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(shorts);