Java Array Swap swap(byte[] data)

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

Description

swap

License

Apache License

Declaration

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

Method Source Code

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

public class Main {
    public static byte[] swap(byte[] data) {
        int count = data.length;
        byte[] result = new byte[count];
        for (int i = 0; i < count; i++) {
            result[i] = data[count - 1 - i];
        }// w w w  .  j av a  2 s .c o m
        return result;
    }
}

Related

  1. swap(boolean[] array, int i1, int i2)
  2. swap(byte size, byte[] target, short targetOffset, byte[] a, short aOffset)
  3. swap(byte[] b1)
  4. swap(byte[] buffer, int i, int j)
  5. swap(byte[] bytes)
  6. swap(byte[] data, int p, int q)
  7. swap(byte[] rv, int offsetA, int offsetB)
  8. swap(Comparable[] a, int oldIndex, int newIndex)
  9. swap(double x[], Object[] corr, int a, int b)