|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.kevinsawicki.http.HttpRequest.Base64
public static class HttpRequest.Base64
Encodes and decodes to and from Base64 notation.
I am placing this code in the Public Domain. Do with it as you will. This software comes with no guarantees or warranties but with plenty of well-wishing instead! Please visit http://iharder.net/base64 periodically to check for updates or to contribute improvements.
Method Summary | |
---|---|
static java.lang.String |
encode(java.lang.String string)
Encode string as a byte array in Base64 annotation. |
static java.lang.String |
encodeBytes(byte[] source)
Encodes a byte array into Base64 notation. |
static java.lang.String |
encodeBytes(byte[] source,
int off,
int len)
Encodes a byte array into Base64 notation. |
static byte[] |
encodeBytesToBytes(byte[] source,
int off,
int len)
Similar to encodeBytes(byte[], int, int) but returns a byte
array instead of instantiating a String. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String encode(java.lang.String string)
string
-
public static java.lang.String encodeBytes(byte[] source)
source
- The data to convert
java.lang.NullPointerException
- if source array is null
java.lang.IllegalArgumentException
- if source array, offset, or length are invalidpublic static java.lang.String encodeBytes(byte[] source, int off, int len)
source
- The data to convertoff
- Offset in array where conversion should beginlen
- Length of data to convert
java.lang.NullPointerException
- if source array is null
java.lang.IllegalArgumentException
- if source array, offset, or length are invalidpublic static byte[] encodeBytesToBytes(byte[] source, int off, int len)
encodeBytes(byte[], int, int)
but returns a byte
array instead of instantiating a String. This is more efficient if you're
working with I/O streams and have large data sets to encode.
source
- The data to convertoff
- Offset in array where conversion should beginlen
- Length of data to convert
java.lang.NullPointerException
- if source array is null
java.lang.IllegalArgumentException
- if source array, offset, or length are invalid
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |