|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mmhttp.protocol.Base64
public class Base64
This class supports Base 64 encoding and decoding. In this library it is primarily used for HTTP digest authentication.
RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies section 6.8. Base64 Content-Transfer-Encoding The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. When encoding a bit stream via the base64 encoding, the bit stream must be presumed to be ordered with the most-significant-bit first. That is, the first bit in the stream will be the high-order bit in the first 8bit byte, and the eighth bit will be the low-order bit in the first 8bit byte, and so on.
Constructor Summary | |
---|---|
Base64()
|
Method Summary | |
---|---|
static byte[] |
decode(byte[] bytes)
Decodes an array of encoded bytes. |
static java.lang.String |
decode(java.lang.String text)
Decodes a block of Base 64 encoded text. |
static byte[] |
encode(byte[] bytes)
Encodes an array of bytes. |
static java.lang.String |
encode(java.lang.String text)
Encodes a block of text. |
static byte |
getValueFor(byte b)
A helper method which is public only for testing purposes. |
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 decode(java.lang.String text) throws java.lang.Exception
text
- to be decoded
java.lang.Exception
public static byte[] decode(byte[] bytes)
bytes
- to be decoded
public static java.lang.String encode(java.lang.String text) throws java.lang.Exception
text
- to encode
java.lang.Exception
public static byte[] encode(byte[] bytes)
bytes
- to encode
public static byte getValueFor(byte b)
b
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |