Java - Convert Big-Endian to Little-Endian
问题 I have the following hex string: 00000000000008a3a41b85b8b29ad444def299fee21793cd8b9e567eab02cd81 but I want it to look like this: 81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000 (Big endian) I think I have to reverse and swap the string, but something like this doesn't give me right result: String hex = "00000000000008a3a41b85b8b29ad444def299fee21793cd8b9e567eab02cd81"; hex = new StringBuilder(hex).reverse().toString(); Result: