/**
* convert big-edian to little-edian
* the operator priority: << is bigger than &
*/
public static int palmSwap32(int i) {
return (i & 0xFF) << 24
| (0xFF & i >> 8) << 16
| (0xFF & i >> 16) << 8
| (0xFF & i >> 24);
}
/**
* convert big-edian to little-edian
* the operator priority: << is bigger than &
*/
public static int palmSwap16(short word) {
return (word & 0xff) << 8 | (0xff00 & word) >> 8;
}
* convert big-edian to little-edian
* the operator priority: << is bigger than &
*/
public static int palmSwap32(int i) {
return (i & 0xFF) << 24
| (0xFF & i >> 8) << 16
| (0xFF & i >> 16) << 8
| (0xFF & i >> 24);
}
/**
* convert big-edian to little-edian
* the operator priority: << is bigger than &
*/
public static int palmSwap16(short word) {
return (word & 0xff) << 8 | (0xff00 & word) >> 8;
}