Question: IN JAVA WITH COMMENTS: Convert a 32-bit integer from Little Endian (Java) to Big Endian (Intel) encoding, and also to other possible encodings as well.
IN JAVA WITH COMMENTS:
Convert a 32-bit integer from Little Endian (Java) to Big Endian (Intel) encoding, and also to other possible encodings as well. Take in an integer encoded in Little Endian, and shuffle its bytes using bit manipulation operators and put them into the specified order.
Constraints:
Must use some sort of bit manipulation using bitwise operators. There are other shortcuts to do this lab, for example you can just no manipulation of the strings to get the bits and sort them using String methods or no, use Integer.reverseBytes method to get cases right.
Sample Input
3
4321
Sample Output
50331648
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
