List of utility methods to do Number Swap
int | swap16(final int aValue) Switches the order of bytes of the given (16-bit) word value. return (((aValue & 0x00ff) << 8) | ((aValue & 0xff00) >> 8));
|
short | swap16(short rgb) swap int a = (rgb >> 8) & 0xFF; int r = rgb & 0xff; return (short) ((r << 8) | a); |
int | swap32(int rgb) swap int a = (rgb >> 24) & 0xFF; int r = (rgb >> 16) & 0xff; int g = (rgb >> 8) & 0xff; int b = rgb & 0xff; return (b << 24) | (g << 16) | (r << 8) | a; |
void | swapAddresses(T o1, T o2) swap Addresses T temp = o2; o2 = o1; o1 = temp; |
byte | swapBits(byte in) swap Bits return (byte) ((swapped_nybbles[in & 0xf] << 4) | (swapped_nybbles[(in & 0xf0) >> 4])); |
int | swapBits(int b, int i, int j) swap Bits final int x = ((b >> i) ^ (b >> j)) & 1; return b ^ ((x << i) | (x << j)); |
int | swapByte(byte b) swap Byte int high = (0x0000000F & ((int) b)); high = high << 4; int low = (int) b >> 4; return high + low; |
int | swapBytes(final int i) Swap bytes return (i << 24) | ((i << 8) & 0x00ff0000) | (i >>> 24) | ((i >> 8) & 0x0000ff00);
|
String | swapCasing(String str) swap Casing int strLen; if ((str == null) || ((strLen = str.length()) == 0)) { return str; StringBuilder builder = new StringBuilder(strLen); char ch = 0; for (int i = 0; i < strLen; i++) { ch = str.charAt(i); ... |
double | swapDouble(double value) Reverses the byte order of the source double value long l = Double.doubleToLongBits(value); l = swapLong(l); return Double.longBitsToDouble(l); |