org.mmbase.util.transformers
Class Base64

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

public class Base64
extends ByteArrayToCharTransformer
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
See Also:
Serialized Form

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.
 String getEncoding()
          Returns the encoding that is currently active
 String transform(byte[] bytes)
           
 byte[] transformBack(String r)
           
 Map transformers()
          Used when registering this class as a possible Transformer
 
Methods inherited from class org.mmbase.util.transformers.ByteArrayToCharTransformer
transform, transform, transformBack, transformBack
 
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.ByteToCharTransformer
transform, transform, transformBack, transformBack
 
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 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 String transform(byte[] bytes)
Specified by:
transform in interface ByteToCharTransformer
Specified by:
transform in class ByteArrayToCharTransformer

transformBack

public byte[] transformBack(String r)
Specified by:
transformBack in interface ByteToCharTransformer
Overrides:
transformBack in class ByteArrayToCharTransformer

getEncoding

public 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.8.1.20060716