de.uplanet.util.encoder
Class QuotedPrintableEncoder

java.lang.Object
  extended by de.uplanet.util.encoder.QuotedPrintableEncoder

@Scriptable
public final class QuotedPrintableEncoder
extends java.lang.Object

Quoted-Printable encoding as described in RFC 2045 section 6.7.

Version:
$Revision: 55002 $

Constructor Summary
QuotedPrintableEncoder()
          Creates a new encoder with default line length and indent for the first encoded line.
QuotedPrintableEncoder(int p_iLineLength, int p_iFirstOffset)
          Creates a new encoder with the given default line length and indent for the first encoded line.
 
Method Summary
 byte[] decode(java.lang.String p_str)
          Decodes a quoted-printable encoded String.
 java.lang.String encode(byte[] p_aby)
          Quoted-printable encodes a String.
 int getFirstLineOffset()
          Returns the indent of the first encoded line.
 int getLineLength()
          Returns the line length of the encoded text.
 void setLineParams(int p_iLineLength, int p_iFirstOffset)
          Sets line length and the indent for the first encoded line.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuotedPrintableEncoder

public QuotedPrintableEncoder()
Creates a new encoder with default line length and indent for the first encoded line.


QuotedPrintableEncoder

public QuotedPrintableEncoder(int p_iLineLength,
                              int p_iFirstOffset)
                       throws de.uplanet.util.encoder.EncoderException
Creates a new encoder with the given default line length and indent for the first encoded line.

Parameters:
p_iLineLength - The line length to be used.
p_iFirstOffset - The indent for the first encoded line.
Throws:
InvalidArgumentException - If the arguments are invalid or incompatible.
de.uplanet.util.encoder.EncoderException
Method Detail

getFirstLineOffset

public int getFirstLineOffset()
Returns the indent of the first encoded line.

Returns:
The indent of the first encoded line.

getLineLength

public int getLineLength()
Returns the line length of the encoded text.

Returns:
The line length of the encoded text.

setLineParams

public void setLineParams(int p_iLineLength,
                          int p_iFirstOffset)
                   throws de.uplanet.util.encoder.EncoderException
Sets line length and the indent for the first encoded line.

These settings are ignored in the decoding process.

Parameters:
p_iLineLength - The line length to be used.
p_iFirstOffset - The indent for the first encoded line.
Throws:
InvalidArgumentException - If the arguments are invalid or incompatible.
de.uplanet.util.encoder.EncoderException

encode

public java.lang.String encode(byte[] p_aby)
Quoted-printable encodes a String.

Parameters:
p_aby - The data to encode.
Returns:
A string representing the quoted-printable encoded data.

decode

public byte[] decode(java.lang.String p_str)
Decodes a quoted-printable encoded String.

Parameters:
p_str - The string that is to be decoded.
Returns:
The decoded data.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.