String与Bas64互转

时间:2025-03-28 13:07:34
byte[] encode = byte[] encode = Base64.getEncoder().encode("http://127.0.0.1/".getBytes()); System.out.println(new String(encode)); byte[] decode1 = Base64.getDecoder().decode(new String(encode)); byte[] decode2 = Base64.getDecoder().decode(encode); System.out.println(new String(decode1)); System.out.println(new String(decode2));