java 数据转换
byte[]转 short[]
byte[] mBuffer = new mBuffer[size];
int count = mBuffer.length >> 1;
short[] dest = new short[count];
for (int i = 0; i < count; i++) {
dest[i] = (short) ((mBuffer[i * 2] & 0xff) | ((mBuffer[2 * i + 1] & 0xff) << 8));
}
short[]转byte[]
byte[] dest = new byte[count << 1];
for (int i = 0; i < count; i++) {
dest[i * 2] = (byte) (mBuffer[i] >> 8);
dest[i * 2 + 1] = (byte) (mBuffer[i] >> 0);
}