org.mmbase.util.transformers
Class Base64

java.lang.Object
  extended byorg.mmbase.util.transformers.Base64
All Implemented Interfaces:
ByteToCharTransformer, ConfigurableTransformer, Transformer

public class Base64
extends java.lang.Object
implements ByteToCharTransformer, ConfigurableTransformer

Uses the sun.misc classes to do BASE64 encoding and decoding. The sun.misc classes are not supported by Sun. Perhaps once we have to plug in another class.

Author:
Michiel Meeuwissen

Constructor Summary
Base64()
           
 
Method Summary
 void configure(int t)
          If a transformer can handle more then one destination format, it can be configured with this.
 java.lang.String getEncoding()
          Returns the encoding that is currently active
 java.lang.String transform(byte[] bytes)
           
 java.io.Writer transform(java.io.InputStream e)
           
 java.io.OutputStream transformBack(java.io.Reader e)
           
 byte[] transformBack(java.lang.String r)
           
 java.util.Map transformers()
          Used when registering this class as a possible Transformer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.util.transformers.Transformer
toString
 

Constructor Detail

Base64

public Base64()
Method Detail

configure

public void configure(int t)
Description copied from interface: ConfigurableTransformer
If a transformer can handle more then one destination format, it can be configured with this. There must be a default, since to can be null.

Specified by:
configure in interface ConfigurableTransformer

transformers

public java.util.Map transformers()
Used when registering this class as a possible Transformer

Specified by:
transformers in interface ConfigurableTransformer
Returns:
A Map with String Integer/Class pairs.

transform

public java.io.Writer transform(java.io.InputStream e)
Specified by:
transform in interface ByteToCharTransformer

transformBack

public java.io.OutputStream transformBack(java.io.Reader e)
Specified by:
transformBack in interface ByteToCharTransformer

transform

public java.lang.String transform(byte[] bytes)
Specified by:
transform in interface ByteToCharTransformer

transformBack

public byte[] transformBack(java.lang.String r)
Specified by:
transformBack in interface ByteToCharTransformer

getEncoding

public java.lang.String getEncoding()
Description copied from interface: ConfigurableTransformer
Returns the encoding that is currently active

Specified by:
getEncoding in interface ConfigurableTransformer
Returns:
An String representing the coding that is currently used.


MMBase build 1.7.1.20041002