sipxtacklib  Version 3.3
List of all members
NetBase64Codec Class Reference

Provides methods for translating to and from base64 encoding. More...

#include <NetBase64Codec.h>

Encoding Operations

These methods translate from the binary data to the encodedData string

static void encode (int dataSize, const char data[], int &encodedDataSize, char encodedData[])
 Encode from one array into another. More...
 
static void encode (int dataSize, const char data[], UtlString &encodedData)
 Encode from an array into a UtlString. More...
 
static void encode (const UtlString &data, UtlString &encodedData)
 Encode from one UtlString into another. More...
 
static int encodedSize (int dataSize)
 

Decoding Operations

The decoding methods translate from the encoded parameter to the binary data All return false if the encoded data value contained any characters that are not legal in the base64 alphabet.

static bool isValid (int encodedDataSize, const char encodedData[])
 
static bool isValid (const UtlString &encodedData)
 
static bool decode (int encodedDataSize, const char encodedData[], int &dataSize, char data[])
 Decode from the character encodedData to the binary data array. More...
 
static bool decode (const UtlString &encodedData, UtlString &data)
 Decode from one UtlString into another. More...
 
static int decodedSize (int encodedDataSize, const char encodedData[])
 Compute the number of output binary octets for given set of encoded octets. More...
 
static int decodedSize (const UtlString &encodedData)
 Compute the number of output binary octets for given set of encoded octets. More...
 

Detailed Description

Provides methods for translating to and from base64 encoding.

Base 64 is a convenient encoding used to translate arbitrary binary data into a fixed 64 character subset of ascii (plus one additional character used to indicate padding). This implementation* uses the alphabet specified in Table 1 of RFC 3548 (which is the standard MIME alphabet).

Member Function Documentation

void encode ( int  dataSize,
const char  data[],
int &  encodedDataSize,
char  encodedData[] 
)
static

Encode from one array into another.

Parameters
dataSizethe size of the binary data in octets
datathe binary data - not null terminated
encodedDataSizeoutput: the size of the encoded data in octets
encodedDataoutput: the encoded data
void encode ( int  dataSize,
const char  data[],
UtlString &  encodedData 
)
static

Encode from an array into a UtlString.

Parameters
dataSizethe size of the binary data in octets
datathe binary data - not null terminated
encodedDataoutput: the encoded data
static void encode ( const UtlString &  data,
UtlString &  encodedData 
)
inlinestatic

Encode from one UtlString into another.

Parameters
datasize is data.length(), not null terminated
encodedDataoutput: the encoded data
int encodedSize ( int  dataSize)
static
Returns
the number of encoded octets for given number of input binary octets
static bool isValid ( int  encodedDataSize,
const char  encodedData[] 
)
inlinestatic
Returns
true iff the encoded data is syntactically valid.
Parameters
encodedDataSizethe size of the encoded data in octets
encodedDatathe encoded data
static bool isValid ( const UtlString &  encodedData)
inlinestatic
Returns
true iff the encoded data is syntactically valid.
Parameters
encodedDatasize is data.length(), not null terminated
bool decode ( int  encodedDataSize,
const char  encodedData[],
int &  dataSize,
char  data[] 
)
static

Decode from the character encodedData to the binary data array.

Returns
false and no data if the encodedData contains any invalid characters.
Parameters
encodedDataSizethe size of the encoded data in octets
encodedDatathe encoded data
dataSizeoutput: the size of the binary data in octets
dataoutput: the binary data - not null terminated
bool decode ( const UtlString &  encodedData,
UtlString &  data 
)
static

Decode from one UtlString into another.

Returns
false and no data if the encodedData contains any invalid characters.
Parameters
encodedDatasize is data.length(), not null terminated
dataoutput: the decoded data
int decodedSize ( int  encodedDataSize,
const char  encodedData[] 
)
static

Compute the number of output binary octets for given set of encoded octets.

Returns
zero if the encodedData contains any invalid characters.
static int decodedSize ( const UtlString &  encodedData)
inlinestatic

Compute the number of output binary octets for given set of encoded octets.

<

Returns
zero if the encodedData contains any invalid characters.
Parameters
encodedDatasize is data.length()

sipXtackLib home page