Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private byte[] getUUIDtoBytes(UUID devId) {
- byte[] uuidBytes = new byte[16];
- ByteBuffer.wrap(uuidBytes)
- .order(ByteOrder.BIG_ENDIAN)
- .putLong(devId.getMostSignificantBits())
- .putLong(devId.getLeastSignificantBits());
- return uuidBytes;
- private UUID toUUID(byte[] bytes) {
- ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
- Long high = byteBuffer.getLong();
- Long low = byteBuffer.getLong();
- return new UUID(high, low);
- }
Add Comment
Please, Sign In to add comment