Class GlobalIdentifier


  • public final class GlobalIdentifier
    extends Object
    Class to represent an active directory GUID. Provides conversion from binary to string and vice versa.
    • Constructor Detail

      • GlobalIdentifier

        private GlobalIdentifier()
        Default constructor.
    • Method Detail

      • toString

        public static String toString​(byte[] guid)
        Converts the supplied GUID to its string format.
        Parameters:
        guid - to convert
        Returns:
        string format of the GUID
      • toBytes

        public static byte[] toBytes​(String guid)
        Converts the supplied GUID to its binary format.
        Parameters:
        guid - to convert
        Returns:
        binary format of the GUID
      • getBytes

        private static byte[] getBytes​(ByteBuffer buffer,
                                       boolean bigEndian)
        Reads bytes from the supplied byte buffer. The byte buffer limit must be set appropriately by the caller.
        Parameters:
        buffer - to read bytes from
        bigEndian - whether to return the bytes as big endian
        Returns:
        long value
      • putBytes

        private static void putBytes​(ByteBuffer buffer,
                                     byte[] bytes,
                                     boolean bigEndian)
        Writes a long into the supplied byte buffer. The byte buffer limit must be set appropriately by the caller.
        Parameters:
        buffer - to write long to
        bytes - to write
        bigEndian - whether to write the bytes as big endian