|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxinmy.weixin4j.base64.BaseNCodec
public abstract class BaseNCodec
reference of apache pivot
Abstract superclass for Base-N encoders and decoders.This class is thread-safe.
| Field Summary | |
|---|---|
static int |
MIME_CHUNK_SIZE
MIME chunk size per RFC 2045 section 6.8. |
static int |
PEM_CHUNK_SIZE
PEM chunk size per RFC 1421 section 4.3.2.4. |
| Method Summary | |
|---|---|
byte[] |
decode(byte[] pArray)
Decodes a byte[] containing characters in the Base-N alphabet. |
Object |
decode(Object obj)
Decodes an Object using the Base-N algorithm. |
byte[] |
decode(String pArray)
Decodes a String containing characters in the Base-N alphabet. |
byte[] |
encode(byte[] pArray)
Encodes a byte[] containing binary data, into a byte[] containing characters in the alphabet. |
Object |
encode(Object obj)
Encodes an Object using the Base-N algorithm. |
String |
encodeAsString(byte[] pArray)
Encodes a byte[] containing binary data, into a String containing characters in the appropriate alphabet. |
String |
encodeToString(byte[] pArray)
Encodes a byte[] containing binary data, into a String containing characters in the Base-N alphabet. |
long |
getEncodedLength(byte[] pArray)
Calculates the amount of space needed to encode the supplied array. |
boolean |
isInAlphabet(byte[] arrayOctet,
boolean allowWSPad)
Tests a given byte array to see if it contains only valid characters within the alphabet. |
boolean |
isInAlphabet(String basen)
Tests a given String to see if it contains only valid characters within the alphabet. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MIME_CHUNK_SIZE
The 76 character limit does not count the trailing CRLF, but counts all other characters, including any equal signs.
public static final int PEM_CHUNK_SIZE
The 64 character limit does not count the trailing CRLF, but counts all other characters, including any equal signs.
| Method Detail |
|---|
public Object encode(Object obj)
throws io.netty.handler.codec.EncoderException
obj - Object to encode
io.netty.handler.codec.EncoderException - if the parameter supplied is not of type byte[]public String encodeToString(byte[] pArray)
pArray - a byte array containing binary data
public String encodeAsString(byte[] pArray)
pArray - a byte array containing binary data
public Object decode(Object obj)
throws io.netty.handler.codec.DecoderException
obj - Object to decode
io.netty.handler.codec.DecoderException - if the parameter supplied is not of type byte[]public byte[] decode(String pArray)
pArray - A String containing Base-N character data
public byte[] decode(byte[] pArray)
pArray - A byte array containing Base-N character data
public byte[] encode(byte[] pArray)
pArray - a byte array containing binary data
public boolean isInAlphabet(byte[] arrayOctet,
boolean allowWSPad)
arrayOctet - byte array to testallowWSPad - if true, then whitespace and PAD are also allowed
true if all bytes are valid characters in the alphabet or
if the byte array is empty; false, otherwisepublic boolean isInAlphabet(String basen)
basen - String to test
true if all characters in the String are valid characters
in the alphabet or if the String is empty; false,
otherwiseisInAlphabet(byte[], boolean)public long getEncodedLength(byte[] pArray)
pArray - byte[] array which will later be encoded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||