
public class ByteTesting {

	public static void main(String[] args) {
		// int: 32 bits
		// long: 64, byte 8, short 16
		
		
		//multibyte integers
		// 0xABCDEF45
		int x = 0xABCDEF45;
		System.out.println(x);
		System.out.printf("%X\n", x);
		
		//Big Endian vs Little Endian
		//Big End: Network order (Sun and Old Apple)
		//Little Endian: Intel, ARM
		
		//single byte
		byte b = (byte)255;
		System.out.println(b);
		
		//break x into 4 bytes
		byte b0 = (byte)(x & 0xFF);
		byte b1 = 0;
		byte b2 = 0;
		byte b3 = 0;
		
		System.out.printf("%x %x %x %x\n", b3, b2, b1, b0);
		
	}

}
