Java UUID to Byte Array uuidToBytes(UUID id)

Here you can find the source of uuidToBytes(UUID id)

Description

uuid To Bytes

License

Open Source License

Declaration

public static byte[] uuidToBytes(UUID id) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import java.util.UUID;

public class Main {
    public static byte[] uuidToBytes(UUID id) {
        byte[] b = new byte[16];
        return ByteBuffer.wrap(b).order(ByteOrder.BIG_ENDIAN).putLong(id.getMostSignificantBits())
                .putLong(id.getLeastSignificantBits()).array();
    }//from www. ja v  a 2s.  com
}

Related

  1. uuidToBase58(UUID uuid)
  2. uuidToByteArray(UUID uuid)
  3. uuidToBytes(UUID uuid)
  4. uuidToBytes(UUID uuid)
  5. uuidToBytes(UUID uuid)
  6. uuidToBytesNullOk(UUID uuid)