public class Base64UrlSafe
extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BASELENGTH
The base length.
|
(package private) static int |
EIGHTBIT
Used to calculate the number of bits in a byte.
|
(package private) static int |
FOURBYTE
Used to get the number of Quadruples.
|
(package private) static int |
LOOKUPLENGTH
Lookup length.
|
(package private) static int |
SIGN
Used to test the sign of a byte.
|
(package private) static int |
SIXTEENBIT
Used when encoding something which has fewer than 24 bits.
|
(package private) static int |
TWENTYFOURBITGROUP
Used to determine how many bits data contains.
|
Constructor and Description |
---|
Base64UrlSafe() |
Modifier and Type | Method and Description |
---|---|
byte[] |
decode(byte[] pArray)
Decodes a byte[] containing containing characters in the Base64 alphabet.
|
Object |
decode(Object pObject)
Decodes an Object using the base64 algorithm.
|
static byte[] |
decodeBase64(byte[] base64Data)
Decodes Base64 data into octets
|
static String |
decodeBase64(String value)
Decode base64.
|
(package private) static byte[] |
discardNonBase64(byte[] data)
Discards any characters outside of the base64 alphabet, per the requirements on page 25 of
RFC 2045 - "Any characters outside of the base64 alphabet are to be ignored in base64 encoded
data."
|
(package private) static byte[] |
discardWhitespace(byte[] data)
Discards any whitespace from a base-64 encoded block.
|
byte[] |
encode(byte[] pArray)
Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64
alphabet.
|
Object |
encode(Object pObject)
Encodes an Object using the base64 algorithm.
|
static byte[] |
encodeBase64(byte[] binaryData)
Encodes binary data using the base64 algorithm.
|
static String |
encodeBase64(String value)
Encode base64.
|
static boolean |
isArrayByteBase64(byte[] arrayOctect)
Tests a given byte array to see if it contains only valid characters within the Base64
alphabet.
|
static final int BASELENGTH
static final int LOOKUPLENGTH
static final int EIGHTBIT
static final int SIXTEENBIT
static final int TWENTYFOURBITGROUP
static final int FOURBYTE
static final int SIGN
public static byte[] decodeBase64(byte[] base64Data)
base64Data
- Byte array containing Base64 datapublic static String decodeBase64(String value)
value
- the valuestatic byte[] discardNonBase64(byte[] data)
data
- The base-64 encoded data to groomstatic byte[] discardWhitespace(byte[] data)
data
- The base-64 encoded data to discard the whitespace from.public static byte[] encodeBase64(byte[] binaryData)
binaryData
- Array containing binary data to encode.public static String encodeBase64(String value)
value
- the valuepublic static boolean isArrayByteBase64(byte[] arrayOctect)
arrayOctect
- byte array to testtrue
if all bytes are valid characters in the Base64 alphabet or if
the byte array is empty; false, otherwisepublic byte[] decode(byte[] pArray)
pArray
- A byte array containing Base64 character datapublic Object decode(Object pObject)
pObject
- Object to decodeIllegalArgumentException
- if the parameter supplied is not of type byte[]public byte[] encode(byte[] pArray)
pArray
- a byte array containing binary datapublic Object encode(Object pObject)
pObject
- Object to encodeIllegalArgumentException
- if the parameter supplied is not of type byte[]Copyright © 2010-2020 Toolsverse. All Rights Reserved.