Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
3
Task/Base64-decode-data/Java/base64-decode-data-1.java
Normal file
3
Task/Base64-decode-data/Java/base64-decode-data-1.java
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
6
Task/Base64-decode-data/Java/base64-decode-data-2.java
Normal file
6
Task/Base64-decode-data/Java/base64-decode-data-2.java
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
void decodeToFile(String path, byte[] bytes) throws IOException {
|
||||
try (FileOutputStream stream = new FileOutputStream(path)) {
|
||||
byte[] decoded = Base64.getDecoder().decode(bytes);
|
||||
stream.write(decoded, 0, decoded.length);
|
||||
}
|
||||
}
|
||||
12
Task/Base64-decode-data/Java/base64-decode-data-3.java
Normal file
12
Task/Base64-decode-data/Java/base64-decode-data-3.java
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
public class Decode {
|
||||
public static void main(String[] args) {
|
||||
String data = "VG8gZXJyIGlzIGh1bWFuLCBidXQgdG8gcmVhbGx5IGZvdWwgdGhpbmdzIHVwIHlvdSBuZWVkIGEgY29tcHV0ZXIuCiAgICAtLSBQYXVsIFIuIEVocmxpY2g=";
|
||||
Base64.Decoder decoder = Base64.getDecoder();
|
||||
byte[] decoded = decoder.decode(data);
|
||||
String decodedStr = new String(decoded, StandardCharsets.UTF_8);
|
||||
System.out.println(decodedStr);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue