XBinder C# Runtime Library  2.8
Classes | Static Public Member Functions | Public Attributes | List of all members
com.objsys.xbinder.runtime.Base64 Class Reference

Classes

class  DecoderWriter
 A Base64.DecoderWriter will write binary data to a java.io.OutputStream, given in the constructor, while decoding the Base64 characters you write. More...
 
class  EncoderOutputStream
 A Base64.EncoderOutputStream will write character data to a java.io.Writer, given in the constructor, while encoding the bytes you write to Base64 notation. More...
 

Static Public Member Functions

static System.String encodeBytes (sbyte[] source)
 Encodes a byte array into Base64 notation. Does not GZip-compress data. More...
 
static System.String encodeBytes (sbyte[] source, int options)
 Encodes a byte array into Base64 notation. More...
 
static System.String encodeBytes (sbyte[] source, int off, int len)
 Encodes a byte array into Base64 notation. Does not GZip-compress data. More...
 
static System.String encodeBytes (sbyte[] source, int off, int len, int options)
 Encodes a byte array into Base64 notation. More...
 
static void decode (char[] source, int off, int len, XBByteArray dest)
 Very low-level access to decoding characters. Does not support automatically gunzipping or any other "fancy" features. More...
 
static sbyte [] decode (char[] source, int off, int len)
 Very low-level access to decoding characters. Does not support automatically gunzipping or any other "fancy" features. More...
 
static void decode (System.String s, XBByteArray dest)
 Decodes data from Base64 notation More...
 
static bool encodeToFile (sbyte[] dataToEncode, System.String filename)
 Convenience method for encoding data to a file. More...
 

Public Attributes

const int NO_OPTIONS = 0
 No options specified. Value is zero. More...
 
const int ENCODE = 1
 Specify encoding. More...
 
const int DECODE = 0
 Specify decoding. More...
 
const int GZIP = 2
 Specify that data should be gzip-compressed. More...
 
const int DONT_BREAK_LINES = 8
 Don't break lines when encoding (violates strict Base64 specification) More...
 

Member Function Documentation

◆ decode() [1/3]

static void com.objsys.xbinder.runtime.Base64.decode ( char []  source,
int  off,
int  len,
XBByteArray  dest 
)
static

Very low-level access to decoding characters. Does not support automatically gunzipping or any other "fancy" features.

Parameters
sourceThe Base64 encoded data
offThe offset of where to begin decoding
lenThe length of characters to decode
destXBByteArray to decode into (starting at 0 offset)
Returns
decoded data

<since> 1.3 </since>

◆ decode() [2/3]

static sbyte [] com.objsys.xbinder.runtime.Base64.decode ( char []  source,
int  off,
int  len 
)
static

Very low-level access to decoding characters. Does not support automatically gunzipping or any other "fancy" features.

Parameters
sourceThe Base64 encoded data
offThe offset of where to begin decoding
lenThe length of characters to decode
Returns
decoded data

<since> 1.3 </since>

◆ decode() [3/3]

static void com.objsys.xbinder.runtime.Base64.decode ( System.String  s,
XBByteArray  dest 
)
static

Decodes data from Base64 notation

Parameters
sthe string to decode
Returns
the decoded data

<since> 1.4 </since>

◆ encodeBytes() [1/4]

static System.String com.objsys.xbinder.runtime.Base64.encodeBytes ( sbyte []  source)
static

Encodes a byte array into Base64 notation. Does not GZip-compress data.

Parameters
sourceThe data to convert

<since> 1.4 </since>

◆ encodeBytes() [2/4]

static System.String com.objsys.xbinder.runtime.Base64.encodeBytes ( sbyte []  source,
int  options 
)
static

Encodes a byte array into Base64 notation.

Valid options:

DONT_BREAK_LINES: don't break lines at 76 characters
Note: Technically, this makes your encoding non-compliant.

Example: encodeBytes( myData, Base64.DONT_BREAK_LINES )

Parameters
sourceThe data to convert
optionsSpecified options
See also
Base64.DONT_BREAK_LINES

<since> 2.0 </since>

◆ encodeBytes() [3/4]

static System.String com.objsys.xbinder.runtime.Base64.encodeBytes ( sbyte []  source,
int  off,
int  len 
)
static

Encodes a byte array into Base64 notation. Does not GZip-compress data.

Parameters
sourceThe data to convert
offOffset in array where conversion should begin
lenLength of data to convert

<since> 1.4 </since>

◆ encodeBytes() [4/4]

static System.String com.objsys.xbinder.runtime.Base64.encodeBytes ( sbyte []  source,
int  off,
int  len,
int  options 
)
static

Encodes a byte array into Base64 notation.

Valid options:

DONT_BREAK_LINES: don't break lines at 76 characters
Note: Technically, this makes your encoding non-compliant.

Example: encodeBytes( myData, Base64.DONT_BREAK_LINES )

Parameters
sourceThe data to convert
offOffset in array where conversion should begin
lenLength of data to convert
optionsSpecified options
See also
Base64.DONT_BREAK_LINES

<since> 2.0 </since>

◆ encodeToFile()

static bool com.objsys.xbinder.runtime.Base64.encodeToFile ( sbyte []  dataToEncode,
System.String  filename 
)
static

Convenience method for encoding data to a file.

Attempts to decode Base64 data and deserialize a Java Object within. Returns null if there was an error.

Parameters
encodedObjectThe Base64 data to decode
Returns
The decoded and deserialized object
Since
1.5
Parameters
dataToEncodebyte array of data to encode in base64 form
filenameFilename for saving encoded data
Returns

true if successful, false otherwise

<since> 2.1 </since>

Member Data Documentation

◆ DECODE

const int com.objsys.xbinder.runtime.Base64.DECODE = 0

Specify decoding.

◆ DONT_BREAK_LINES

const int com.objsys.xbinder.runtime.Base64.DONT_BREAK_LINES = 8

Don't break lines when encoding (violates strict Base64 specification)

◆ ENCODE

const int com.objsys.xbinder.runtime.Base64.ENCODE = 1

Specify encoding.

◆ GZIP

const int com.objsys.xbinder.runtime.Base64.GZIP = 2

Specify that data should be gzip-compressed.

◆ NO_OPTIONS

const int com.objsys.xbinder.runtime.Base64.NO_OPTIONS = 0

No options specified. Value is zero.