Here you can find the source of endsWith(int[] data, int[] ends)
public static final boolean endsWith(int[] data, int[] ends)
//package com.java2s; public class Main { public static final boolean endsWith(int[] data, int[] ends) { if (data == null || ends == null) { return false; }//from w w w. j a va 2 s . c o m if (data.length < ends.length) { return false; } int start = data.length - ends.length; for (int i = 0; i < ends.length; i++) { if (data[start + i] != ends[i]) { return false; } } return true; } }