Class UuidConversion

java.lang.Object
net.paulem.arcana.uuid.UuidConversion

public class UuidConversion extends Object
Utility methods for converting UUIDs to and from their raw 16-byte representation.
  • Constructor Details

    • UuidConversion

      public UuidConversion()
  • Method Details

    • asUuid

      public static UUID asUuid(byte[] bytes)
      Reconstructs a UUID from a 16-byte array, as produced by asBytes(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 UUID represented by bytes
    • asBytes

      public static byte[] asBytes(UUID uuid)
      Converts a UUID to 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