Here you can find the source of toThriftBinary(UUID uuid)
public static byte[] toThriftBinary(UUID uuid)
//package com.java2s; /*/*from www. jav a 2s . c o m*/ Apache Licensed Code modified from: */ import java.nio.ByteBuffer; import java.util.UUID; public class Main { public static final int UUID_BYTES = 16; public static byte[] toThriftBinary(UUID uuid) { ByteBuffer bb = ByteBuffer.wrap(new byte[UUID_BYTES]); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return bb.array(); } }