Here you can find the source of bitAnd(byte[] a, byte[] b)
public static byte[] bitAnd(byte[] a, byte[] b)
//package com.java2s; /* ***************************************************************************** * Copyright (c) 2007-2008 Bioclipse Project * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w . j a v a 2s .co m*/ * *******************************************************************************/ public class Main { public static byte[] bitAnd(byte[] a, byte[] b) { byte[] result = new byte[a.length]; for (int i = 0; i < result.length; i++) { result[i] = (byte) (a[i] & b[i]); } return result; } }