List of utility methods to do UUID from
UUID | UUIDFromBytes(byte[] array) UUID From Bytes if (array == null) return null; ByteBuffer buf = ByteBuffer.wrap(array); return new UUID(buf.getLong(), buf.getLong()); |
UUID | uuidFromBytes(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()); |
UUID | uuidFromBytes(byte[] bytes) uuid From Bytes ByteBuffer buffer = ByteBuffer.wrap(bytes); long msb = buffer.getLong(); long lsb = buffer.getLong(); return new UUID(msb, lsb); |
UUID | uuidFromMsftBinary(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]; ... |
UUID | uuidFromThriftBinary(byte[] uuidThriftBytes) uuid From Thrift Binary ByteBuffer bb = ByteBuffer.wrap(uuidThriftBytes); return new UUID(bb.getLong(), bb.getLong()); |