Here you can find the source of toBytes(final UUID uuid)
private static byte[] toBytes(final UUID uuid)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; import java.util.UUID; public class Main { private static byte[] toBytes(final UUID uuid) { return ByteBuffer.allocate(Integer.SIZE).putInt(uuid.hashCode()).array(); }/*from w w w . j a v a 2 s. c o m*/ }