Here you can find the source of xorend(byte[] in1, byte[] in2)
private static byte[] xorend(byte[] in1, byte[] in2)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Sebastian Stenzel/* w w w . j av a 2s. co m*/ * This file is licensed under the terms of the MIT license. * See the LICENSE.txt file for more info. * * Contributors: * Sebastian Stenzel - initial API and implementation ******************************************************************************/ import java.util.Arrays; public class Main { private static byte[] xorend(byte[] in1, byte[] in2) { if (in1 == null || in2 == null || in1.length < in2.length) { throw new IllegalArgumentException("Length of first input must be >= length of second input."); } final byte[] result = Arrays.copyOf(in1, in1.length); final int diff = in1.length - in2.length; for (int i = 0; i < in2.length; i++) { result[i + diff] = (byte) (result[i + diff] ^ in2[i]); } return result; } }