net.wimpi.pim.util
Class EncodingUtility

java.lang.Object
  |
  +--net.wimpi.pim.util.EncodingUtility

public class EncodingUtility
extends java.lang.Object

Utility class providing encoding and decoding methods.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger
See Also:
Base64, QuotedPrintable

Constructor Summary
EncodingUtility()
           
 
Method Summary
static byte[] decodeBase64(byte[] data)
          Returns the decoded data.
static byte[] decodeBase64(java.lang.String data)
          Returns the decoded String.
static java.lang.String decodeQP(java.lang.String data)
          Returns the decoded String.
static byte[] encodeBase64(byte[] data)
          Returns the Base64 encoded data.
static byte[] encodeLineBreaks(byte[] data)
          Encodes line breaks into an escape sequence.
static java.io.InputStream encodeLineBreaks(java.io.InputStream data)
          Returns an InputStream filtering raw line breaks into escape sequences.
static java.lang.String encodeLineBreaks(java.lang.String str)
          Convenience method that encodes line breaks into an escape sequence.
static java.lang.String encodeQP(java.lang.String data)
          Returns the encoded String.
static byte[] removeWhiteSpace(byte[] data)
          Removes whitespace from the given data.
static java.io.InputStream removeWhiteSpace(java.io.InputStream data)
          Returns an InputStream which will not include any whitespace from the passed in InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncodingUtility

public EncodingUtility()
Method Detail

decodeBase64

public static byte[] decodeBase64(byte[] data)
Returns the decoded data.

Parameters:
data - the Base64 encoded data.
Returns:
the decoded data.

decodeBase64

public static byte[] decodeBase64(java.lang.String data)
Returns the decoded String.

Parameters:
data - a Base64 encoded String.
Returns:
the decoded data.

encodeBase64

public static byte[] encodeBase64(byte[] data)
Returns the Base64 encoded data.

Parameters:
data - the data to be encoded.
Returns:
the Base64 encoded data.

decodeQP

public static java.lang.String decodeQP(java.lang.String data)
Returns the decoded String.

Parameters:
data - a Quoted-Printable encoded String.
Returns:
the decoded String.

encodeQP

public static java.lang.String encodeQP(java.lang.String data)
Returns the encoded String.

Parameters:
data - a String to be Quoted-Printable encoded.
Returns:
the encoded String.

removeWhiteSpace

public static byte[] removeWhiteSpace(byte[] data)
Removes whitespace from the given data.

Parameters:
data - the data as byte[].
Returns:
the data without whitespaces.

removeWhiteSpace

public static java.io.InputStream removeWhiteSpace(java.io.InputStream data)
                                            throws java.io.IOException
Returns an InputStream which will not include any whitespace from the passed in InputStream.

Parameters:
data - the data as InputStream.
Returns:
an InputStream.
Throws:
java.io.IOException - if an I/O error occurs.

encodeLineBreaks

public static byte[] encodeLineBreaks(byte[] data)
Encodes line breaks into an escape sequence.

Parameters:
data - the data with raw line breaks.
Returns:
the data with encoded line breaks.

encodeLineBreaks

public static java.lang.String encodeLineBreaks(java.lang.String str)
Convenience method that encodes line breaks into an escape sequence.

Parameters:
str - the data with raw line breaks as String.
Returns:
the data with encoded line breaks as String.

encodeLineBreaks

public static java.io.InputStream encodeLineBreaks(java.io.InputStream data)
                                            throws java.io.IOException
Returns an InputStream filtering raw line breaks into escape sequences.

Parameters:
data - an InputStream.
Returns:
an InputStream.
Throws:
java.io.IOException - if an I/O error occurs.


Copyright © 2001-2003 jpim team.