I'm trying to read an int (32 bits) to a bytebuffer object.
I've used the method "Bytebuffer.allocate(4)", and I wish to take every 8 bits(1 byte) of the given int, into the bytebuffer object.
How can I do this?
(I need to use it in order to convert every Byte(8 bits) to a number between 0-255)
Edit: I'm just trying to get the 32 bit of an int(it's for a school project and the assignment said specifcly "we will use int not as a number, but as a binary sequence of 32 bits" and that's what I'm trying to do but with absolutely no success.
Thanks.