fm.liveswitch.Base64 Class Reference

Static Public Member Functions

static String encode (byte[] b)
 Computes the base64 representation of a byte array. More...
 
static String encodeBuffer (DataBuffer buffer)
 Computes the base64 representation of a buffer. More...
 
static byte[] decode (String s)
 Computes the byte representation of a base64 string. More...
 
static Boolean tryEncode (byte[] b, Holder< String > encoded)
 Computes the base64 representation of a byte array. More...
 
static Boolean tryEncodeBuffer (DataBuffer buffer, Holder< String > encoded)
 Computes the base64 representation of a buffer. More...
 
static Boolean tryDecode (String s, Holder< byte[]> decoded)
 Computes the byte representation of a base64 string. More...
 

Member Function Documentation

◆ decode()

static byte [] fm.liveswitch.Base64.decode ( String  s)
static

Computes the byte representation of a base64 string.

Parameters
sThe input base64 string.
Returns
The byte array.

◆ encode()

static String fm.liveswitch.Base64.encode ( byte[]  b)
static

Computes the base64 representation of a byte array.

Parameters
bThe input byte array.
Returns
The base64 string.

◆ encodeBuffer()

static String fm.liveswitch.Base64.encodeBuffer ( DataBuffer  buffer)
static

Computes the base64 representation of a buffer.

Parameters
bufferThe input buffer.
Returns
The base64 string.

◆ tryDecode()

static Boolean fm.liveswitch.Base64.tryDecode ( String  s,
Holder< byte[]>  decoded 
)
static

Computes the byte representation of a base64 string.

Parameters
sThe input base64 string.
decodedThe byte array.
Returns
true if the decode succeeds; otherwise false

◆ tryEncode()

static Boolean fm.liveswitch.Base64.tryEncode ( byte[]  b,
Holder< String >  encoded 
)
static

Computes the base64 representation of a byte array.

Parameters
bThe input byte array.
encodedThe base64 string.
Returns
true if the encode succeeds; otherwise false

◆ tryEncodeBuffer()

static Boolean fm.liveswitch.Base64.tryEncodeBuffer ( DataBuffer  buffer,
Holder< String >  encoded 
)
static

Computes the base64 representation of a buffer.

Parameters
bufferThe input buffer.
encodedThe base64 string.
Returns
true if the encode succeeds; otherwise false