private boolean isIEBrowser ( byte [ ] agent ) { int end = agent . length - 4 ; for ( int i = 0 ; i < end ; ) { // check for MSIE if ( ' ' == agent [ i ] ) { if ( ' ' == agent [ ++ i ] && ' ' == agent [ ++ i ] && ' ' == agent [ ++ i ] ) { return true ; } // i now points to the failing char, loop and see if it was another M } else { i ++ ; } } return false ; }
Check the user - agent input header to see if it contains the IE browser marker .