Package net.paulem.arcana.uuid
Class UuidConversion
java.lang.Object
net.paulem.arcana.uuid.UuidConversion
Utility methods for converting
UUIDs to and from their raw 16-byte representation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Converts aUUIDto its raw 16-byte representation, with the most significant bits written first, followed by the least significant bits.static UUIDasUuid(byte[] bytes) Reconstructs aUUIDfrom a 16-byte array, as produced byasBytes(UUID).
-
Constructor Details
-
UuidConversion
public UuidConversion()
-
-
Method Details
-
asUuid
Reconstructs aUUIDfrom a 16-byte array, as produced byasBytes(UUID). The first 8 bytes are read as the most significant bits and the last 8 as the least significant bits.- Parameters:
bytes- the 16-byte array to convert- Returns:
- the
UUIDrepresented bybytes
-
asBytes
Converts aUUIDto its raw 16-byte representation, with the most significant bits written first, followed by the least significant bits.- Parameters:
uuid- the UUID to convert- Returns:
- the 16-byte array representing
uuid
-