Skip to content

Store two integers in a longStore two integers in a long in Java.

Java
long l = (((long)x) << 32) | (y & 0xffffffffL);
int x = (int)(l >> 32);
int y = (int)l;