Here you can find the source of swapByteOrder(byte[] a)
public static void swapByteOrder(byte[] a)
//package com.java2s; //License from project: Open Source License public class Main { public static void swapByteOrder(byte[] a) { for (int i = 0; i < a.length / 2; i++) { byte tmp = a[i]; a[i] = a[a.length - 1 - i];// ww w . j av a 2 s . c om a[a.length - 1 - i] = tmp; } } }