com.funambol.util
Class QuotedPrintable

java.lang.Object
  extended by com.funambol.util.QuotedPrintable

public class QuotedPrintable
extends java.lang.Object

A class containing static methods to perform decoding from quoted printable content transfer encoding and to encode into


Constructor Summary
QuotedPrintable()
           
 
Method Summary
static int decode(byte[] qp)
          A method to decode quoted printable encoded data.
static java.lang.String decode(byte[] qp, java.lang.String enc)
           
static byte[] encode(byte[] bytes)
          Encodes an array of bytes into an array of quoted-printable 7-bit characters.
static java.lang.String encode(java.lang.String str)
          Encodes a String into a String of quoted-printable 7-bit characters.
static java.lang.String encode(java.lang.String str, java.lang.String enc)
          Encodes a String into a String of quoted-printable 7-bit characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuotedPrintable

public QuotedPrintable()
Method Detail

decode

public static int decode(byte[] qp)
A method to decode quoted printable encoded data. It overrides the same input byte array to save memoty. Can be done because the result is surely smaller than the input.

Parameters:
qp - a byte array to decode.
Returns:
the length of the decoded array.

decode

public static java.lang.String decode(byte[] qp,
                                      java.lang.String enc)

encode

public static final byte[] encode(byte[] bytes)
Encodes an array of bytes into an array of quoted-printable 7-bit characters.

Parameters:
bytes - Array of bytes to be encoded
Returns:
Array of bytes containing quoted-printable representation of the input

encode

public static final java.lang.String encode(java.lang.String str,
                                            java.lang.String enc)
                                     throws java.io.UnsupportedEncodingException
Encodes a String into a String of quoted-printable 7-bit characters.

Parameters:
str - string to be encoded
enc - the encoding in which the string is encoded
Returns:
a string containing quoted-printable representation of the input
Throws:
java.io.UnsupportedEncodingException

encode

public static final java.lang.String encode(java.lang.String str)
                                     throws java.io.UnsupportedEncodingException
Encodes a String into a String of quoted-printable 7-bit characters.

Parameters:
str - string to be encoded
Returns:
a string containing quoted-printable representation of the input
Throws:
java.io.UnsupportedEncodingException


Copyright © 2001-2009 Funambol.