|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jakewharton.pingdom.util.Base64
public class Base64
Provides serialization and deserialization between a regular string and a base-64 encoded string.
This class was taken from Nabeel Mukhtar's github-java-sdk.
Nested Class Summary | |
---|---|
static class |
Base64.InputStream
The Class InputStream. |
static class |
Base64.OutputStream
The Class OutputStream. |
Field Summary | |
---|---|
static int |
DECODE
The Constant DECODE. |
static int |
DO_BREAK_LINES
The Constant DO_BREAK_LINES. |
static int |
DONT_GUNZIP
The Constant DONT_GUNZIP. |
static int |
ENCODE
The Constant ENCODE. |
static int |
GZIP
The Constant GZIP. |
static int |
NO_OPTIONS
The Constant NO_OPTIONS. |
static int |
ORDERED
The Constant ORDERED. |
static int |
URL_SAFE
The Constant URL_SAFE. |
Method Summary | |
---|---|
static byte[] |
decode(byte[] source)
Decode. |
static byte[] |
decode(byte[] source,
int off,
int len,
int options)
Decode. |
static byte[] |
decode(String s)
Decode. |
static byte[] |
decode(String s,
int options)
Decode. |
static void |
decodeFileToFile(String infile,
String outfile)
Decode file to file. |
static byte[] |
decodeFromFile(String filename)
Decode from file. |
static void |
decodeToFile(String dataToDecode,
String filename)
Decode to file. |
static Object |
decodeToObject(String encodedObject)
Decode to object. |
static Object |
decodeToObject(String encodedObject,
int options,
ClassLoader loader)
Decode to object. |
static void |
encode(ByteBuffer raw,
ByteBuffer encoded)
Encode. |
static void |
encode(ByteBuffer raw,
CharBuffer encoded)
Encode. |
static String |
encodeBytes(byte[] source)
Encode bytes. |
static String |
encodeBytes(byte[] source,
int options)
Encode bytes. |
static String |
encodeBytes(byte[] source,
int off,
int len)
Encode bytes. |
static String |
encodeBytes(byte[] source,
int off,
int len,
int options)
Encode bytes. |
static byte[] |
encodeBytesToBytes(byte[] source)
Encode bytes to bytes. |
static byte[] |
encodeBytesToBytes(byte[] source,
int off,
int len,
int options)
Encode bytes to bytes. |
static void |
encodeFileToFile(String infile,
String outfile)
Encode file to file. |
static String |
encodeFromFile(String filename)
Encode from file. |
static String |
encodeObject(Serializable serializableObject)
Encode object. |
static String |
encodeObject(Serializable serializableObject,
int options)
Encode object. |
static void |
encodeToFile(byte[] dataToEncode,
String filename)
Encode to file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_OPTIONS
public static final int ENCODE
public static final int DECODE
public static final int GZIP
public static final int DONT_GUNZIP
public static final int DO_BREAK_LINES
public static final int URL_SAFE
public static final int ORDERED
Method Detail |
---|
public static void encode(ByteBuffer raw, ByteBuffer encoded)
raw
- the rawencoded
- the encodedpublic static void encode(ByteBuffer raw, CharBuffer encoded)
raw
- the rawencoded
- the encodedpublic static String encodeObject(Serializable serializableObject) throws IOException
serializableObject
- the serializable object
IOException
- Signals that an I/O exception has occurred.public static String encodeObject(Serializable serializableObject, int options) throws IOException
serializableObject
- the serializable objectoptions
- the options
IOException
- Signals that an I/O exception has occurred.public static String encodeBytes(byte[] source)
source
- the source
public static String encodeBytes(byte[] source, int options) throws IOException
source
- the sourceoptions
- the options
IOException
- Signals that an I/O exception has occurred.public static String encodeBytes(byte[] source, int off, int len)
source
- the sourceoff
- the offlen
- the len
public static String encodeBytes(byte[] source, int off, int len, int options) throws IOException
source
- the sourceoff
- the offlen
- the lenoptions
- the options
IOException
- Signals that an I/O exception has occurred.public static byte[] encodeBytesToBytes(byte[] source)
source
- the source
public static byte[] encodeBytesToBytes(byte[] source, int off, int len, int options) throws IOException
source
- the sourceoff
- the offlen
- the lenoptions
- the options
IOException
- Signals that an I/O exception has occurred.public static byte[] decode(byte[] source) throws IOException
source
- the source
IOException
- Signals that an I/O exception has occurred.public static byte[] decode(byte[] source, int off, int len, int options) throws IOException
source
- the sourceoff
- the offlen
- the lenoptions
- the options
IOException
- Signals that an I/O exception has occurred.public static byte[] decode(String s) throws IOException
s
- the s
IOException
- Signals that an I/O exception has occurred.public static byte[] decode(String s, int options) throws IOException
s
- the soptions
- the options
IOException
- Signals that an I/O exception has occurred.public static Object decodeToObject(String encodedObject) throws IOException, ClassNotFoundException
encodedObject
- the encoded object
IOException
- Signals that an I/O exception has occurred.
ClassNotFoundException
- the class not found exceptionpublic static Object decodeToObject(String encodedObject, int options, ClassLoader loader) throws IOException, ClassNotFoundException
encodedObject
- the encoded objectoptions
- the optionsloader
- the loader
IOException
- Signals that an I/O exception has occurred.
ClassNotFoundException
- the class not found exceptionpublic static void encodeToFile(byte[] dataToEncode, String filename) throws IOException
dataToEncode
- the data to encodefilename
- the filename
IOException
- Signals that an I/O exception has occurred.public static void decodeToFile(String dataToDecode, String filename) throws IOException
dataToDecode
- the data to decodefilename
- the filename
IOException
- Signals that an I/O exception has occurred.public static byte[] decodeFromFile(String filename) throws IOException
filename
- the filename
IOException
- Signals that an I/O exception has occurred.public static String encodeFromFile(String filename) throws IOException
filename
- the filename
IOException
- Signals that an I/O exception has occurred.public static void encodeFileToFile(String infile, String outfile) throws IOException
infile
- the infileoutfile
- the outfile
IOException
- Signals that an I/O exception has occurred.public static void decodeFileToFile(String infile, String outfile) throws IOException
infile
- the infileoutfile
- the outfile
IOException
- Signals that an I/O exception has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |