public boolean endsWith ( Bytes suffix ) { Objects . requireNonNull ( suffix , "endsWith(Bytes suffix) cannot have null parameter" ) ; int startOffset = this . length - suffix . length ; if ( startOffset < 0 ) { return false ; } else { int end = startOffset + this . offset + suffix . length ; for ( int i = startOffset + this . offset , j = suffix . offset ; i < end ; i ++ , j ++ ) { if ( this . data [ i ] != suffix . data [ j ] ) { return false ; } } } return true ; }
Checks if this has the passed suffix