public static String convertToDashedString ( byte [ ] objectGUID ) { StringBuilder displayStr = new StringBuilder ( ) ; displayStr . append ( prefixZeros ( objectGUID [ 3 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 2 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 1 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 0 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 5 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 4 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 7 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 6 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 8 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 9 ] & 0xFF ) ) ; displayStr . append ( "-" ) ; displayStr . append ( prefixZeros ( objectGUID [ 10 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 11 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 12 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 13 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 14 ] & 0xFF ) ) ; displayStr . append ( prefixZeros ( objectGUID [ 15 ] & 0xFF ) ) ; return displayStr . toString ( ) ; }
Convert the byte array to Active Directory GUID format .