Java xor xorInPlace(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int size)

Here you can find the source of xorInPlace(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int size)

Description

xor In Place

License

Open Source License

Declaration

public static void xorInPlace(byte[] source, int sourceOffset, byte[] destination, int destinationOffset,
            int size) 

Method Source Code

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

public class Main {
    public static void xorInPlace(byte[] source, int sourceOffset, byte[] destination, int destinationOffset,
            int size) {
        xor(destination, destinationOffset, source, sourceOffset, destination, destinationOffset, size);
    }//  w w  w  .  ja  va 2s  .  co  m

    public static void xor(byte[] firstBytes, int firstOffset, byte[] secondBytes, int secondOffset,
            byte[] outBytes, int outOffset, int size) {
        for (int i = 0; i < size; i++) {
            outBytes[outOffset + i] = (byte) (firstBytes[firstOffset + i] ^ secondBytes[secondOffset + i]);
        }
    }
}

Related

  1. xor(short b1, short b2)
  2. xor(String key, String input)
  3. xor(T l1, T l2)
  4. xor32(byte[] a, short aOffset, byte[] b, short bOffset, byte[] result, short offset)
  5. xorFolding(final long hash, final int shift)
  6. xorInt64OverBytesLE(long val, byte[] data, int ofs)
  7. XORInto(byte[] dest, byte[] src)
  8. xorLong(byte[] aBuffer, int aOffset, long aValue)
  9. xorMV(byte[] i_Value)