Java Array Swap swap(byte[] b1)

Here you can find the source of swap(byte[] b1)

Description

swap

License

Apache License

Declaration

public static byte[] swap(byte[] b1) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static byte[] swap(byte[] b1) {
        for (int i = 0; i < (b1.length - 4); i = i + 4) {
            byte temp = b1[i];
            b1[i] = b1[i + 1];/*from  w w  w .j  a  va 2s  .c  o  m*/
            b1[i + 1] = b1[i + 2];
            b1[i + 2] = b1[i + 3];
            b1[i + 3] = temp;
        }
        return b1;
    }
}

Related

  1. swap(boolean[] array, int i1, int i2)
  2. swap(byte size, byte[] target, short targetOffset, byte[] a, short aOffset)
  3. swap(byte[] buffer, int i, int j)
  4. swap(byte[] bytes)
  5. swap(byte[] data)
  6. swap(byte[] data, int p, int q)