|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.util.Base64
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.
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 |
public Base64()
Method Detail |
public void testBase64InputStream(InputStream is) throws IOException
fileName
- the file from which the BASE64 encoded data is readIOException
- if an file error occursBase64InputStream
public void testBase64OutputStream(OutputStream os) throws IOException
fileName
- the file to which the BASE64 encoded data shall be writtenIOException
- if an file error occursBase64OutputStream
public void testBase64() throws IOException
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.
IOException
- if an I/O error occurspublic void start()
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.
public static void main(String[] arg) throws IOException
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). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |