Created
December 21, 2022 16:11
-
-
Save omidp/82e42f3963b41a3466c6a52cb0f7b19a to your computer and use it in GitHub Desktop.
java uuid to db binary 16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public byte[] getByte(UUID uuid) { | |
ByteBuffer bb = ByteBuffer.wrap(new byte[16]); | |
bb.putLong(uuid.getMostSignificantBits()); | |
bb.putLong(uuid.getLeastSignificantBits()); | |
return bb.array(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment