Here you can find the source of and(byte[] a, byte[] b)
public static byte[] and(byte[] a, byte[] b)
//package com.java2s; //License from project: Mozilla Public License public class Main { public static byte[] and(byte[] a, byte[] b) { if (a.length != b.length) { throw new IllegalArgumentException("Arrays a and b should have equal length"); }//from www . ja v a 2 s . c om byte[] result = new byte[a.length]; for (int i = 0; i < a.length; i++) { result[i] = (byte) (a[i] & b[i]); } return result; } }