List of utility methods to do Unsigned Number Create
long | unsignedIntToLong(Integer i) unsigned Int To Long return i & 0xffffffffL;
|
byte | unsignedIntToSignedByte(final int i) Converts an unsigned integer to a signed byte (e.g., 255 becomes -1). if (i > 255 || i < 0) { throw new IllegalArgumentException( "Can only convert non-negative integers between [0,255] to byte: [" + i + "]"); if (i < 128) { return (byte) i; return (byte) (i - 256); ... |
String | unsignedIntToString(int x) Returns a string representation of x, where x is treated as unsigned. return unsignedIntToString(x, 10);
|
String | unsignedIntToString(int x, int radix) Returns a string representation of x for the given radix, where x is treated as unsigned. long asLong = x & INT_MASK; return Long.toString(asLong, radix); |
long | unsignedIntValue(byte[] data, int offset) unsigned Int Value long result = 0; int multiply = 1; int value = 0; for (int i = 0; i < 4; i++) { value = data[i + offset]; if (value < 0) value = value + 256; result = result + (value * multiply); ... |
int | unsignedLeb128Size(int value) Gets the number of bytes in the unsigned LEB128 encoding of the given value. int remaining = value >> 7; int count = 0; while (remaining != 0) { remaining >>= 7; count++; return count + 1; |
boolean | unsignedLessThan(long a, long b) Return true if a (interepted as an unsigned string of bits) is less than b (interpreted likewise) long shifted_a = (a >>> 1); long shifted_b = (b >>> 1); return ((shifted_a == shifted_b) ? ((a & 1) < (b & 1)) : (shifted_a < shifted_b)); |
int | unsignedLocalIntersect2by2(final short[] set1, final int length1, final short[] set2, final int length2, final short[] buffer) unsigned Local Intersectby if ((0 == length1) || (0 == length2)) { return 0; int k1 = 0; int k2 = 0; int pos = 0; short s1 = set1[k1]; short s2 = set2[k2]; ... |
int | unsignedLocalIntersect2by2Cardinality(final short[] set1, final int length1, final short[] set2, final int length2) Compute the cardinality of the intersection if ((0 == length1) || (0 == length2)) { return 0; int k1 = 0; int k2 = 0; int pos = 0; short s1 = set1[k1]; short s2 = set2[k2]; ... |
long | unsignedLong(byte b) Get the specified byte's value as an unsigned long. return 0x00000000000000ff & b;
|