public static boolean endsWith(BytesRef ref, BytesRef suffix) {int startAt = ref.length - suffix.length;if (startAt < 0) {return false;}return Arrays.equals(ref.bytes, ref.offset + startAt, ref.offset + startAt + suffix.length,suffix.bytes, suffix.offset, suffix.offset + suffix.length);}
public static bool EndsWith(BytesRef @ref, BytesRef suffix) {return SliceEquals(@ref, suffix, @ref.Length - suffix.Length);}