Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.mail.util
Class QOutputStream  view QOutputStream download QOutputStream.java

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended bygnu.mail.util.QPOutputStream
              extended bygnu.mail.util.QOutputStream

public class QOutputStream
extends QPOutputStream

Provides RFC 2047 "B" transfer decoding. See section 4.2:

The "Q" encoding is similar to the "Quoted-Printable" content- transfer-encoding defined in RFC 2045. It is designed to allow text containing mostly ASCII characters to be decipherable on an ASCII terminal without decoding.

  1. Any 8-bit value may be represented by a "=" followed by two hexadecimal digits. For example, if the character set in use were ISO-8859-1, the "=" character would thus be encoded as "=3D", and a SPACE by "=20". (Upper case should be used for hexadecimal digits "A" through "F".)
  2. The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_" (underscore, ASCII 95.). (This character may not pass through some internetwork mail gateways, but its use will greatly enhance readability of "Q" encoded data with mail readers that do not support this encoding.) Note that the "_" always represents hexadecimal 20, even if the SPACE character occupies a different code position in the character set in use.
  3. 8-bit values which correspond to printable ASCII characters other than "=", "?", and "_" (underscore), MAY be represented as those characters. (But see section 5 for restrictions.) In particular, SPACE and TAB MUST NOT be represented as themselves within encoded words.


    Field Summary
    private static int SPACE
               
    private  java.lang.String specials
               
    private static java.lang.String TEXT_SPECIALS
               
    private static int UNDERSCORE
               
    private static java.lang.String WORD_SPECIALS
               
     
    Fields inherited from class gnu.mail.util.QPOutputStream
     
    Fields inherited from class java.io.FilterOutputStream
    out
     
    Constructor Summary
    QOutputStream(java.io.OutputStream out, boolean word)
              Constructor.
     
    Method Summary
    static int encodedLength(byte[] bytes, boolean word)
               
     void write(int c)
              Write a character to the stream.
     
    Methods inherited from class gnu.mail.util.QPOutputStream
    close, flush, output, write, write
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    SPACE

    private static final int SPACE
    See Also:
    Constant Field Values

    UNDERSCORE

    private static final int UNDERSCORE
    See Also:
    Constant Field Values

    TEXT_SPECIALS

    private static java.lang.String TEXT_SPECIALS

    WORD_SPECIALS

    private static java.lang.String WORD_SPECIALS

    specials

    private java.lang.String specials
    Constructor Detail

    QOutputStream

    public QOutputStream(java.io.OutputStream out,
                         boolean word)
    Constructor. The word parameter is used to indicate whether the bytes passed to this stream are considered to be RFC 822 "word" tokens or "text" tokens.

    Method Detail

    write

    public void write(int c)
               throws java.io.IOException
    Write a character to the stream.

    Overrides:
    write in class QPOutputStream

    encodedLength

    public static int encodedLength(byte[] bytes,
                                    boolean word)