Java Convert via ByteBuffer toUuid(byte[] bytes)

Here you can find the source of toUuid(byte[] bytes)

Description

to Uuid

License

Open Source License

Declaration

public static UUID toUuid(byte[] bytes) 

Method Source Code


//package com.java2s;
import java.nio.ByteBuffer;

import java.util.UUID;

public class Main {
    public static UUID toUuid(byte[] bytes) {
        ByteBuffer bb = ByteBuffer.wrap(bytes);
        long hi = bb.getLong();
        long lo = bb.getLong();
        return new UUID(hi, lo);
    }/*from  w  w  w. j  a v  a  2s . c  om*/
}

Related

  1. toText(@Nonnull byte[] bytes)
  2. toThriftBinary(UUID uuid)
  3. toURI(String value)
  4. toUTF(byte[] bytes)
  5. toUTF8(String str)
  6. toUUID(byte[] uuid)
  7. toUUIDBinary(UUID uuid)