demo.util
Class Base64

java.lang.Object
  |
  +--demo.util.Base64

public class Base64
extends Object

Tests the Base64 implementation.

First the encoding/decoding process is observed by means of some ASCII strings. Subsequently random chosen data serves as input to create an Base64 encoded output stream writing the encoded data to a "test\Base64Test.txt" file. The Base64InputStream test reads the encoded data from this file, decodes it, and compares it with the original plain data.

Version:
File Revision 12

Constructor Summary
Base64()
           
 
Method Summary
static void main(String[] arg)
          Performs some tests for the Base64 implementation.
 void start()
          Tests the Base64 implementation.
 void testBase64()
          Tests the correctness of the Base64 implementation.
 void testBase64InputStream(InputStream is)
          Tests the Base64InputStream implementation by reading BASE64 encoded data from a file, decoding it, and comparing the recovered data with the original data.
 void testBase64OutputStream(OutputStream os)
          Tests the Base64OutputStream implementation by BASE46 encoding randomly generated data and writing it to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64

public Base64()
Method Detail

testBase64InputStream

public void testBase64InputStream(InputStream is)
                           throws IOException
Tests the Base64InputStream implementation by reading BASE64 encoded data from a file, decoding it, and comparing the recovered data with the original data.

Parameters:
fileName - the file from which the BASE64 encoded data is read
Throws:
IOException - if an file error occurs
See Also:
Base64InputStream

testBase64OutputStream

public void testBase64OutputStream(OutputStream os)
                            throws IOException
Tests the Base64OutputStream implementation by BASE46 encoding randomly generated data and writing it to a file.
Parameters:
fileName - the file to which the BASE64 encoded data shall be written
Throws:
IOException - if an file error occurs
See Also:
Base64OutputStream

testBase64

public void testBase64()
                throws IOException
Tests the correctness of the Base64 implementation.

Given are two arrays of ASCII-strings indicating the plain and the corresponding BASE64 encoded data. First the encoding process is tested by encoding the plain data and comparing it with the given BASE64 encoded data. Subsequently the result of the encoding process is decoded and checked against the original plain data.

Throws:
IOException - if an I/O error occurs

start

public void start()
Tests the Base64 implementation.

First the encoding/decoding process is observed by means of some ASCII strings. Subsequently random chosen data serves as input to create an Base64 encoded output stream writing the encoded data to a "test\Base64Test.txt" file. The Base64InputStream test reads the encoded data from this file, decodes it, and compares it with the original plain data.


main

public static void main(String[] arg)
                 throws IOException
Performs some tests for the Base64 implementation.
Throws:
IOException - if an file error occurs

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK