Here you can find the source of memchr(T[] ptr, T value)
public static <T> int memchr(T[] ptr, T value)
//package com.java2s; //License from project: Open Source License public class Main { public static <T> int memchr(T[] ptr, T value) { for (int c = 0; c < ptr.length; c++) { if (value.equals(ptr[c])) return c; if (value.hashCode() == ptr[c].hashCode()) return c; }/*from w ww.jav a2 s .c o m*/ return -1; } }