--- aliases: tags: - maturity/π± date: 2024-09-14 zero-link: - "[[../../meta/zero/00 Π‘Π½ΠΈΠΏΠ΅ΡΡ Π΄Π»Ρ Java|00 Π‘Π½ΠΈΠΏΠ΅ΡΡ Π΄Π»Ρ Java]]" parents: - "[[../other/Base64]]" linked: --- **ΠΠΎΠ΄ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π°Π½Π½ΡΡ Π² Base64:** ```java import java.util.Base64; public class Base64EncodingExample { public static void main(String[] args) { // ΠΡΠΈΠΌΠ΅Ρ ΡΡΡΠΎΠΊΠΈ Π΄Π»Ρ ΠΊΠΎΠ΄ΠΈΡΠΎΠ²Π°Π½ΠΈΡ String originalString = "This is a test string for Base64 encoding."; // ΠΠΎΠ΄ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΡΡΠΎΠΊΠΈ Π² Base64 String encodedString = Base64.getEncoder().encodeToString(originalString.getBytes()); System.out.println("Encoded String: " + encodedString); } } ``` **ΠΠ΅ΠΊΠΎΠ΄ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π°Π½Π½ΡΡ ΠΈΠ· Base64:** ```java import java.util.Base64; public class Base64DecodingExample { public static void main(String[] args) { // ΠΡΠΈΠΌΠ΅Ρ Π·Π°ΠΊΠΎΠ΄ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠΉ ΡΡΡΠΎΠΊΠΈ Base64 String encodedString = "VGhpcyBpcyBhIHRlc3Qgc3RyaW5nIGZvciBCYXNlNjQgZW5jb2Rpbmcu"; // ΠΠ΅ΠΊΠΎΠ΄ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΡΡΠΎΠΊΠΈ ΠΈΠ· Base64 byte[] decodedBytes = Base64.getDecoder().decode(encodedString); String decodedString = new String(decodedBytes); System.out.println("Decoded String: " + decodedString); } } ``` *** ## ΠΠ΅ΡΠ° ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ **ΠΠ±Π»Π°ΡΡΡ**:: [[../../meta/zero/00 Π‘Π½ΠΈΠΏΠ΅ΡΡ Π΄Π»Ρ Java|00 Π‘Π½ΠΈΠΏΠ΅ΡΡ Π΄Π»Ρ Java]] **Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ**:: [[../other/Base64|Base64]] **ΠΡΡΠΎΡΠ½ΠΈΠΊ**:: **Π‘ΠΎΠ·Π΄Π°Π½Π°**:: [[2024-09-14]] **ΠΠ²ΡΠΎΡ**:: ### ΠΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΠ΅ ΠΌΠ°ΡΠ΅ΡΠΈΠ°Π»Ρ - ### ΠΠΎΡΠ΅ΡΠ½ΠΈΠ΅ Π·Π°ΠΌΠ΅ΡΠΊΠΈ <!-- QueryToSerialize: LIST FROM [[]] WHERE contains(Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ, this.file.link) or contains(parents, this.file.link) -->