Here you can find the source of uuidToByteArray(UUID uuid)
public static byte[] uuidToByteArray(UUID uuid)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; import java.util.UUID; public class Main { public static byte[] uuidToByteArray(UUID uuid) { ByteBuffer bb = ByteBuffer.wrap(new byte[16]); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return bb.array(); }//from w ww .jav a 2 s . c om }