package com.mindprod.example;
import static java.lang.System.*;
/**
* Demonstrate use of various ways of reversing byte order.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2011-01-10 initial version
* @since 2011-01-10
*/
public class TestReverseBytes
{
/**
* test harness
*
* @param args not used
*/
public static void main( String[] args )
{
int test = 0xabcdef82;
out.println( Integer.toHexString( test ) );
out.println( Integer.toHexString( Integer.reverseBytes( test ) ) );
test = 0x0000abcd;
out.println( Integer.toHexString( Integer.reverseBytes( test ) ) );
out.println( Integer.toHexString( Short.reverseBytes( ( short ) test ) ) );
out.println( Integer.toHexString( Character.reverseBytes( ( char ) test ) ) );
}
}