libcommonc++  0.7
Base64 Class Reference

Base-64 encoding and decoding routines. More...

#include <Base64.h++>

Static Public Member Functions

static size_t encode (ByteBuffer &input, CharBuffer &output)
 Base64-encode the contents of a buffer. More...
 
static size_t encode (const byte_t *input, size_t inputLen, char *output, size_t outputLen)
 Base64-encode a block of bytes. More...
 
static size_t decode (CharBuffer &input, ByteBuffer &output)
 Base64-decode the contents of a buffer. More...
 
static size_t decode (const char *input, size_t inputLen, byte_t *output, size_t outputLen)
 Base64-decode a block of characters. More...
 

Detailed Description

Base-64 encoding and decoding routines.

Author
Mark Lindner

Member Function Documentation

◆ decode() [1/2]

size_t decode ( CharBuffer input,
ByteBuffer output 
)
static

Base64-decode the contents of a buffer.

Parameters
inputThe buffer containing the input data.
outputThe output buffer. If NULL, the function returns the amount of space needed.
Returns
The number of characters written to the output buffer, or 0 if a decoding error occurred. If there was not enough room in the output buffer, the value returned will indicate the amount of space needed.

◆ decode() [2/2]

size_t decode ( const char *  input,
size_t  inputLen,
byte_t output,
size_t  outputLen 
)
static

Base64-decode a block of characters.

Parameters
inputThe input buffer.
inputLenThe length of the input buffer.
outputThe output buffer.
outputLenThe length of the output buffer. If NULL, the function returns the amount of space needed.
Returns
The number of characters written to the output buffer, or 0 if a decoding error occurred. If the output buffer was too small, the value returned will be greater than outputLen, and will indicate the size required.

◆ encode() [1/2]

size_t encode ( ByteBuffer input,
CharBuffer output 
)
static

Base64-encode the contents of a buffer.

Parameters
inputThe buffer containing the input data.
outputThe output buffer.
Returns
The number of characters written to the output buffer, or 0 if an encoding error occurred. If there was not enough room in the output buffer, the value returned will indicate the amount of space needed.

◆ encode() [2/2]

size_t encode ( const byte_t input,
size_t  inputLen,
char *  output,
size_t  outputLen 
)
static

Base64-encode a block of bytes.

Parameters
inputThe input buffer.
inputLenThe length of the input buffer.
outputThe output buffer.
outputLenThe length of the output buffer.
Returns
The number of characters written to the output buffer, or 0 if an encoding error occurred. If the output buffer was too small, the value returned will be greater than outputLen, and will indicate the size required.

The documentation for this class was generated from the following files: