Here you can find the source of swapOrder32(byte[] buffer, int byteOffset, int sampleCount)
public static void swapOrder32(byte[] buffer, int byteOffset, int sampleCount)
//package com.java2s; public class Main { public static void swapOrder32(byte[] buffer, int byteOffset, int sampleCount) { int byteMax = sampleCount * 4 + byteOffset - 3; int i = byteOffset; while (i < byteMax) { byte h = buffer[i]; buffer[i] = buffer[i + 3];/* www . j a va 2s . c om*/ buffer[i + 3] = h; i++; h = buffer[i]; buffer[i] = buffer[++i]; buffer[i++] = h; i++; } } public static void swapOrder32(byte[] inBuffer, int inByteOffset, byte[] outBuffer, int outByteOffset, int sampleCount) { while (sampleCount > 0) { outBuffer[outByteOffset++] = inBuffer[inByteOffset + 3]; outBuffer[outByteOffset++] = inBuffer[inByteOffset + 2]; outBuffer[outByteOffset++] = inBuffer[inByteOffset + 1]; outBuffer[outByteOffset++] = inBuffer[inByteOffset++]; inByteOffset++; inByteOffset++; inByteOffset++; sampleCount--; } } }