티스토리 뷰

[Java] Base64 encode/decode

 

//...
import java.util.Base64;
//...

public class Application {

	public static void main(String[] args)
	{
    	var text = "테스트";
		var bytes = text.getBytes();
		var base64 = Base64.getEncoder().encodeToString(bytes);
		var decodedBytes = Base64.getDecoder().decode(bytes);
		var decodedText = new String(decodedBytes);
	}

}

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
글 보관함