I want to store two ints in a long (instead of having to create a new Point
object every time).
Currently, I tried this. It's not working, but I don't know what is wrong with it:
// x and y are ints
long l = x;
l = (l << 32) | y;
And I'm getting the int values like so:
x = (int) l >> 32;
y = (int) l & 0xffffffff;