convert byte array to guid using bytebuffer and UUID, byte size has 4

1.3k Views Asked by At

I want to convert byte array to Guid. The following link has solved my problem.

Convert ByteArray to UUID java

If the byte size is 8/16 then there is no problem for me. But if the byte size has 4 then I am getting

java.nio.bufferoverflowexception because of 4 bytes. Because bytebuffer getLong() method will read every 8 bytes. How can solve this problem. Any idea?

Thanks mindus

0

There are 0 best solutions below