Java Array Swap swap(final byte[] src)

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

Description

swap

License

Open Source License

Declaration

public static byte[] swap(final byte[] src) 

Method Source Code

//package com.java2s;
/*/*from  www .  j a v a  2s.  co m*/
 * Copyright (c) 2016 PrivatBank IT <acsk@privatbank.ua>. All rights reserved.
 * Redistribution and modifications are permitted subject to BSD license.
 */

public class Main {
    public static byte[] swap(final byte[] src) {

        final byte[] dst = new byte[src.length];

        for (int i = 0; i < src.length; i++) {
            dst[dst.length - i - 1] = src[i];
        }

        return dst;
    }
}

Related

  1. swap(double x[], Object[] corr, int a, int b)
  2. swap(double[] a, int i, int j)
  3. swap(double[] array, int i, int j)
  4. swap(double[] data, int i, int j)
  5. swap(final byte[] array, int firstIndex, int secondIndex)
  6. swap(final float[] pVertices, final int pVertexStride, final int pVertexIndexA, final int pVertexIndexB)
  7. swap(final int a[], final int i, final int j)
  8. swap(final int[] array, final int i, final int j)
  9. swap(final int[] array, final int indexA, final int indexB)