Here you can find the source of memchr(char[] haystack, int offset, char needle, int num)
private static int memchr(char[] haystack, int offset, char needle, int num)
//package com.java2s; //License from project: Open Source License public class Main { private static int memchr(char[] haystack, int offset, char needle, int num) { if (num != 0) { int p = 0; do {/*from w w w . j a va 2s . co m*/ if (haystack[offset + p] == needle) return 1; p++; } while (--num != 0); } return 0; } }