Java Utililty Methods UUID from

List of utility methods to do UUID from

Description

The list of methods to do UUID from are organized into topic(s).

Method

UUIDUUIDFromBytes(byte[] array)
UUID From Bytes
if (array == null)
    return null;
ByteBuffer buf = ByteBuffer.wrap(array);
return new UUID(buf.getLong(), buf.getLong());
UUIDuuidFromBytes(byte[] b)
uuid From Bytes
if (b.length < 16) {
    throw new IllegalArgumentException("uuid needs at least 16 bytes");
ByteBuffer bb = ByteBuffer.wrap(b);
bb.flip();
bb.order(ByteOrder.BIG_ENDIAN);
return new UUID(bb.getLong(), bb.getLong());
UUIDuuidFromBytes(byte[] bytes)
uuid From Bytes
ByteBuffer buffer = ByteBuffer.wrap(bytes);
long msb = buffer.getLong();
long lsb = buffer.getLong();
return new UUID(msb, lsb);
UUIDuuidFromMsftBinary(byte[] uuidMsftBytes)
uuid From Msft Binary
byte[] uuidJavaBytes = new byte[16];
uuidJavaBytes[0] = uuidMsftBytes[3];
uuidJavaBytes[1] = uuidMsftBytes[2];
uuidJavaBytes[2] = uuidMsftBytes[1];
uuidJavaBytes[3] = uuidMsftBytes[0];
uuidJavaBytes[4] = uuidMsftBytes[5];
uuidJavaBytes[5] = uuidMsftBytes[4];
uuidJavaBytes[6] = uuidMsftBytes[7];
...
UUIDuuidFromThriftBinary(byte[] uuidThriftBytes)
uuid From Thrift Binary
ByteBuffer bb = ByteBuffer.wrap(uuidThriftBytes);
return new UUID(bb.getLong(), bb.getLong());