private static boolean endsWith(byte[] subject, byte[] suffix) {
    int start = subject.length - suffix.length;
    if (start < 0) {
      return false;
    }
    for (int i = start; i < subject.length; i++) {
      if (subject[i] != suffix[i - start]) {
        return false;
      }
    }
    return true;
  }
private static boolean endsWith ( byte [ ] subject , byte [ ] suffix ) { int start = subject . length - suffix . length ; if ( start < 0 ) { return false ; } for ( int i = start ; i < subject . length ; i ++ ) { if ( subject [ i ] != suffix [ i - start ] ) { return false ; } } return true ; }
Returns {@code true} if {@code subject} ends with {@code suffix}.