Java Array Invert invertByteArray(byte[] array)

Here you can find the source of invertByteArray(byte[] array)

Description

invert Byte Array

License

Creative Commons License

Declaration

public static void invertByteArray(byte[] array) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    public static void invertByteArray(byte[] array) {

        for (int i = 0; i < array.length; i++) {
            short temp = array[i];
            // array[i] = (byte) ((short)Byte.MAX_VALUE - temp); // Compute as Short since Java uses signed bytes
        }//from  ww  w  .  j  a  v  a2s . c o m

    }
}

Related

  1. invertArray(final byte[] array)
  2. invertArray(int[] a, int top)
  3. invertArray(Object[] data)
  4. invertBits(byte[] input)
  5. InvertBitsInByte(Boolean[] booleanByte)
  6. InvertBytes(Boolean[] dataToInvert)
  7. invertedLength3(float[] a)
  8. inverter(double[] vector)
  9. invertHostNameFast(byte[] tokens, int offset, int length, byte[] destinationBuffer)