private boolean matchShort ( final ByteBuffer bbuf , final ByteOrder bo , final boolean needMask , final short sMask ) throws IOException { bbuf . order ( bo ) ; short got ; final String testContent = getContent ( ) ; if ( testContent . startsWith ( "0x" ) ) { got = ( short ) Integer . parseInt ( testContent . substring ( 2 ) , 16 ) ; } else if ( testContent . startsWith ( "&" ) ) { got = ( short ) Integer . parseInt ( testContent . substring ( 3 ) , 16 ) ; } else { got = ( short ) Integer . parseInt ( testContent ) ; } short found = bbuf . getShort ( ) ; if ( needMask ) { found = ( short ) ( found & sMask ) ; } if ( got != found ) { return false ; } return true ; }
Match short .