Java tutorial
//package com.java2s; import java.nio.ByteBuffer; import java.util.UUID; public class Main { public static UUID toUUID(byte[] bytes) { ByteBuffer bb = ByteBuffer.wrap(bytes); long firstLong = bb.getLong(); long secondLong = bb.getLong(); return new UUID(firstLong, secondLong); } }