Here you can find the source of invert(byte[] key)
public static byte[] invert(byte[] key)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.Arrays; public class Main { public static byte[] invert(byte[] key) { byte[] inverted = Arrays.copyOf(key, key.length); for (int i = 0; i < inverted.length; i++) { inverted[i] = (byte) (inverted[i] & 0xFF); }//from w w w . j a va 2 s .c o m return inverted; } }