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

A Base64.DecoderWriter will write binary data to a java.io.OutputStream, given in the constructor, while decoding the Base64 characters you write. More...

Inheritance diagram for com.objsys.xbinder.runtime.Base64.DecoderWriter:

Public Member Functions

 DecoderWriter (System.IO.Stream out_Renamed)
 Constructs a Base64.DecoderWriter. More...
 
void write (char theChar)
 Writes the char to the output stream after converting from Base64 notation. When decoding, chars are buffered four at a time. More...
 
override void Write (System.Char[] theChars, int off, int len)
 Calls write(char) repeatedly until len chars are written. More...
 
override void Flush ()
 Method added by PHIL. [Thanks, PHIL. -Rob] This pads the buffer without closing the stream. More...
 
override void Close ()
 Flushes and closes (I think, in the superclass) the stream. More...
 

Detailed Description

A Base64.DecoderWriter will write binary data to a java.io.OutputStream, given in the constructor, while decoding the Base64 characters you write.

Convenience method for decoding data to a file.

Parameters
dataToDecodeBase64-encoded data as a string
filenameFilename for saving decoded data
Returns
true if successful, false otherwise
Since
2.1 Convenience method for reading a base64-encoded file and decoding it.
Parameters
filenameFilename for reading encoded data
Returns
decoded byte array or null if unsuccessful
Since
2.1 Convenience method for reading a binary file and base64-encoding it.
Parameters
filenameFilename for reading binary data
Returns
base64-encoded string or null if unsuccessful
Since
2.1 A Base64.InputStream will read data from another java.io.InputStream, given in the constructor, and encode/decode to/from Base64 notation on the fly.
See also
Base64
Since
1.3 Constructs a Base64.InputStream in DECODE mode.
Parameters
inthe java.io.InputStream from which to read data.
Since
1.3 Constructs a Base64.InputStream in either ENCODE or DECODE mode.

Valid options:

  ENCODE or DECODE: Encode or Decode as data is read.
  DONT_BREAK_LINES: don't break lines at 76 characters
    (only meaningful when encoding)
    Note: Technically, this makes your encoding non-compliant.

Example: new Base64.InputStream( in, Base64.DECODE )

Parameters
inthe java.io.InputStream from which to read data.
optionsSpecified options
See also
Base64::ENCODE
Base64::DECODE
Base64::DONT_BREAK_LINES
Since
2.0 Reads enough of the input stream to convert to/from Base64 and returns the next byte.
Returns
next byte
Since
1.3 Calls read() repeatedly until the end of stream is reached or len bytes are read. Returns number of bytes read into array or -1 if end of stream is encountered.
Parameters
destarray to hold values
offoffset for array
lenmax number of bytes to read into array
Returns
bytes read into array or -1 if end of stream is encountered.
Since
1.3
See also
Base64

<since> 1.3 </since>

Constructor & Destructor Documentation

◆ DecoderWriter()

com.objsys.xbinder.runtime.Base64.DecoderWriter.DecoderWriter ( System.IO.Stream  out_Renamed)

Constructs a Base64.DecoderWriter.

Parameters
outthe java.io.OutputStream to which data will be written.

<since> 1.3 </since>

Member Function Documentation

◆ Close()

override void com.objsys.xbinder.runtime.Base64.DecoderWriter.Close ( )

Flushes and closes (I think, in the superclass) the stream.

<since> 1.3 </since>

◆ Flush()

override void com.objsys.xbinder.runtime.Base64.DecoderWriter.Flush ( )

Method added by PHIL. [Thanks, PHIL. -Rob] This pads the buffer without closing the stream.

◆ write()

void com.objsys.xbinder.runtime.Base64.DecoderWriter.write ( char  theChar)

Writes the char to the output stream after converting from Base64 notation. When decoding, chars are buffered four at a time.

Parameters
theCharthe byte to write

<since> 1.3 </since>

◆ Write()

override void com.objsys.xbinder.runtime.Base64.DecoderWriter.Write ( System.Char []  theChars,
int  off,
int  len 
)

Calls write(char) repeatedly until len chars are written.

Parameters
theCharsarray from which to read chars
offoffset for array
lenmax number of chars to read into array

<since> 1.3 </since>