Here you can find the source of toBytes(UUID id)
public static byte[] toBytes(UUID id)
//package com.java2s; import java.nio.ByteBuffer; import java.util.UUID; public class Main { public static byte[] toBytes(UUID id) { byte[] bytes = new byte[16]; ByteBuffer bb = ByteBuffer.wrap(bytes); bb.putLong(id.getMostSignificantBits()); bb.putLong(id.getLeastSignificantBits()); return bytes; }/* www. j a v a 2 s .c o m*/ }