---
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) -->