Java Array Has inArray(byte needle, byte[] haystack)

Here you can find the source of inArray(byte needle, byte[] haystack)

Description

in Array

License

Open Source License

Declaration

public static boolean inArray(byte needle, byte[] haystack) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean inArray(byte needle, byte[] haystack) {
        for (byte item : haystack) {
            if (item == needle) {
                return true;
            }/*from w w  w  .j ava2s.  c om*/
        }
        return false;
    }

    public static <T> boolean inArray(T object, T[] array) {
        for (T item : array) {
            if (object.equals(item)) {
                return true;
            }
        }
        return false;
    }
}

Related

  1. arrayHasContent(Object[] array)
  2. arrayHasContiguousRowEntries(double[] aVector)
  3. arrayHasElements(Object[] obj)
  4. arrayHasTaints(int[] a)
  5. inArray(byte needle, byte[] haystack)
  6. inArray(char[] array, char c)
  7. inArray(final String s, final String[] array)
  8. inArray(final T[] array, final U search)
  9. inArray(int[] arr, int search)