Java UUID to Byte Array uuidToByteArray(UUID uuid)

Here you can find the source of uuidToByteArray(UUID uuid)

Description

uuid To Byte Array

License

Apache License

Declaration

public static byte[] uuidToByteArray(UUID uuid) 

Method Source Code


//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
}

Related

  1. uuidToBase58(UUID uuid)
  2. uuidToBytes(UUID id)
  3. uuidToBytes(UUID uuid)
  4. uuidToBytes(UUID uuid)
  5. uuidToBytes(UUID uuid)