I'm working on a Java project where I have been tasked with extracting raw data from both integer and long variables.
Here's an input:
Integer intValue = 42;
Long longValue = 9876543210L;
How can I extract the raw data as bytes from intValue and longValue?
For integer
For long
The above prints in hexadecimal format. To print each byte as 0/1 style bits use: