private void reverse ( byte [ ] buffer , int offset , int length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reverse" , new Object [ ] { buffer , offset , length } ) ; byte temp ; for ( int i = 0 ; i < length / 2 ; i ++ ) { temp = buffer [ offset + i ] ; buffer [ offset + i ] = buffer [ offset + ( length - 1 ) - i ] ; buffer [ offset + ( length - 1 ) - i ] = temp ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reverse" ) ; }
This method reverses a sequence of bytes within a byte array . It is used for byte swapping numeric values