question: public static void doSwap ( ByteBuffer bBuf ) { bBuf . rewind ( ) ; int n = bBuf . limit ( ) ; for ( int i = 0 ; i < n ; i += 4 ) { byte b = bBuf . get ( i ) ; bBuf . put ( i , bBuf . get ( i + 3 ) ) ; bBuf . put ( i + 3 , b ) ; b = bBuf . get ( i + 1 ) ; bBuf . put ( i + 1 , bBuf . get ( i + 2 ) ) ; bBuf . put ( i + 2 , b ) ; } }
target:  Swap the bytes aligned on word boundaries in a buffer.