|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.spinn3r.api.util.Base64
public class Base64
Package which supplies Base64 encoding and decoding of data. This class provides encoding of byte arrays into Base64-encoded strings, and decoding the other way.
NOTE! This is modified Base64 with slightly different characters than usual, so it won't require escaping when used in URLs.
NOTE! This class only does the padding that's normal in Base64 if the 'true' flag is given to the encode() method. This is because Base64 requires that the length of the encoded text be a multiple of four characters, padded with '_'. Without the 'true' flag, we don't add these '_' characters.
| Constructor Summary | |
|---|---|
Base64()
|
|
| Method Summary | |
|---|---|
static byte[] |
decode(byte[] in)
Handles the standards-compliant (padded with '~' signs) as well as our shortened form. |
static byte[] |
decode(java.lang.String inStr)
Handles the standards-compliant (padded with '~' signs) as well as our shortened form. |
static java.lang.String |
encode(byte[] in)
|
static java.lang.String |
encode(byte[] in,
boolean equalsPad,
char[] alphabet,
int limit)
Caller should specify equalsPad=true if they want a standards compliant encoding. |
static java.lang.String |
encode(byte[] in,
int limit)
|
static byte[] |
encodeAsByteArray(byte[] in)
|
static byte[] |
encodeAsByteArray(byte[] in,
boolean equalsPad,
char[] alphabet)
Caller should specify equalsPad=true if they want a standards compliant encoding. |
static java.lang.String |
encodeFilesafe(byte[] in)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Base64()
| Method Detail |
|---|
public static java.lang.String encode(byte[] in)
public static byte[] encodeAsByteArray(byte[] in)
public static java.lang.String encode(byte[] in,
int limit)
public static java.lang.String encodeFilesafe(byte[] in)
public static java.lang.String encode(byte[] in,
boolean equalsPad,
char[] alphabet,
int limit)
public static byte[] encodeAsByteArray(byte[] in,
boolean equalsPad,
char[] alphabet)
public static byte[] decode(java.lang.String inStr)
throws java.lang.Exception
java.lang.Exception
public static byte[] decode(byte[] in)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||