Here you can find the source of invert(byte abyte0[])
public static final byte[] invert(byte abyte0[])
//package com.java2s; /**//from w w w .j av a 2s . c o m * This file is part of JEMMA - http://jemma.energy-home.org * (C) Copyright 2013 Telecom Italia (http://www.telecomitalia.it) * * JEMMA is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License (LGPL) version 3 * or later as published by the Free Software Foundation, which accompanies * this distribution and is available at http://www.gnu.org/licenses/lgpl.html * * JEMMA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License (LGPL) for more details. * */ public class Main { public static final byte[] invert(byte abyte0[]) { if (abyte0 == null || abyte0.length == 0) return abyte0; byte abyte1[] = new byte[abyte0.length]; for (int i = 0; i < abyte0.length; i++) abyte1[i] = abyte0[abyte0.length - i - 1]; return abyte1; } public static final void invert(byte abyte0[], int i, byte abyte1[], int j, int k) { if (abyte0 == null || abyte0.length == 0 || k == 0) return; int l = Math.min(abyte0.length - 1, (i + k) - 1); for (int i1 = l; i1 >= i; i1--) { if (j >= abyte1.length) throw new ArrayIndexOutOfBoundsException( "Destination array has insuffiecient length. Destination offset reached " + j + " while dest length is " + abyte1.length); abyte1[j] = abyte0[i1]; j++; } } }