I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 08ee62b5 authored by aum's avatar aum Committed by zzz
Browse files

Added convenience methods:

 - String encode(String raw)
 - String decode(String raw)
parent 5b83aed7
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,10 @@ public class Base64 { ...@@ -42,6 +42,10 @@ public class Base64 {
private final static Log _log = new Log(Base64.class); private final static Log _log = new Log(Base64.class);
/** added by aum */
public static String encode(String source) {
return encode(source.getBytes());
}
public static String encode(byte[] source) { public static String encode(byte[] source) {
return encode(source, 0, (source != null ? source.length : 0)); return encode(source, 0, (source != null ? source.length : 0));
} }
...@@ -55,6 +59,10 @@ public class Base64 { ...@@ -55,6 +59,10 @@ public class Base64 {
return safeEncode(source, off, len, useStandardAlphabet); return safeEncode(source, off, len, useStandardAlphabet);
} }
/** convenience method added by aum */
public static String decode(String s) {
return new String(decode(s));
}
public static byte[] decode(String s) { public static byte[] decode(String s) {
return safeDecode(s, false); return safeDecode(s, false);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment