Here you can find the source of writeUUID(ByteBuffer buffer, UUID uuid)
public static void writeUUID(ByteBuffer buffer, UUID uuid) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.ByteBuffer; import java.util.UUID; public class Main { public static void writeUUID(ByteBuffer buffer, UUID uuid) throws IOException { buffer.putLong(uuid.getMostSignificantBits()); buffer.putLong(uuid.getLeastSignificantBits()); }/* ww w .j a va 2 s. co m*/ }