All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.tools.codec.Base64Decoder

java.lang.Object
   |
   +----w3c.tools.codec.Base64Decoder

public class Base64Decoder
extends Object
Decode a BASE64 encoded input stream to some output stream. This class implements BASE64 decoding, as specified in the MIME specification.

See Also:
Base64Encoder

Constructor Index

 o Base64Decoder(InputStream, OutputStream)
Create a decoder to decode a stream.
 o Base64Decoder(String)
Create a decoder to decode a String.

Method Index

 o main(String[])
Test the decoder.
 o process()
Do the actual decoding.
 o processString()
Do the decoding, and return a String.

Constructors

 o Base64Decoder
 public Base64Decoder(String input)
Create a decoder to decode a String.

Parameters:
input - The string to be decoded.
 o Base64Decoder
 public Base64Decoder(InputStream in,
                      OutputStream out)
Create a decoder to decode a stream.

Parameters:
in - The input stream (to be decoded).
out - The output stream, to write decoded data to.

Methods

 o process
 public void process() throws IOException, Base64FormatException
Do the actual decoding. Process the input stream by decoding it and emiting the resulting bytes into the output stream.

Throws: IOException
If the input or output stream accesses failed.
Throws: Base64FormatException
If the input stream is not compliant with the BASE64 specification.
 o processString
 public String processString() throws Base64FormatException
Do the decoding, and return a String. This methods should be called when the decoder is used in String mode. It decodes the input string to an output string that is returned.

Throws: RuntimeException
If the object wasn't constructed to decode a String.
Throws: Base64FormatException
If the input string is not compliant with the BASE64 specification.
 o main
 public static void main(String args[])
Test the decoder. Run it with one argument: the string to be decoded, it will print out the decoded value.


All Packages  Class Hierarchy  This Package  Previous  Next  Index