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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!