public static String extractTargetNameFromType2Message ( byte [ ] msg , Integer msgFlags ) throws UnsupportedEncodingException { // Read the security buffer to determine where the target name // is stored and what it's length is byte [ ] targetName = readSecurityBufferTarget ( msg , 12 ) ; // now we convert it to a string int flags = msgFlags == null ? extractFlagsFromType2Message ( msg ) : msgFlags ; if ( ByteUtilities . isFlagSet ( flags , FLAG_NEGOTIATE_UNICODE ) ) { return new String ( targetName , "UTF-16LE" ) ; } return new String ( targetName , "ASCII" ) ; }
Extracts the target name from the type 2 message .