org.apache.james.mime4j.codec
Class CodecUtil

java.lang.Object
  extended by org.apache.james.mime4j.codec.CodecUtil

public class CodecUtil
extends java.lang.Object

Utility methods related to codecs.


Constructor Summary
CodecUtil()
           
 
Method Summary
static void copy(java.io.InputStream in, java.io.OutputStream out)
          Copies the contents of one stream to the other.
static void encodeBase64(java.io.InputStream in, java.io.OutputStream out)
          Encodes the given stream using base64.
static void encodeQuotedPrintable(java.io.InputStream in, java.io.OutputStream out)
          Encodes the given stream using Quoted-Printable.
static void encodeQuotedPrintableBinary(java.io.InputStream in, java.io.OutputStream out)
          Encodes the given stream using Quoted-Printable.
static java.io.OutputStream wrapBase64(java.io.OutputStream out)
          Wraps the given stream in a Base64 encoder.
static java.io.OutputStream wrapQuotedPrintable(java.io.OutputStream out, boolean binary)
          Wraps the given stream in a Quoted-Printable encoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodecUtil

public CodecUtil()
Method Detail

copy

public static void copy(java.io.InputStream in,
                        java.io.OutputStream out)
                 throws java.io.IOException
Copies the contents of one stream to the other.

Parameters:
in - not null
out - not null
Throws:
java.io.IOException

encodeQuotedPrintableBinary

public static void encodeQuotedPrintableBinary(java.io.InputStream in,
                                               java.io.OutputStream out)
                                        throws java.io.IOException
Encodes the given stream using Quoted-Printable. This assumes that stream is binary and therefore escapes all line endings.

Parameters:
in - not null
out - not null
Throws:
java.io.IOException

encodeQuotedPrintable

public static void encodeQuotedPrintable(java.io.InputStream in,
                                         java.io.OutputStream out)
                                  throws java.io.IOException
Encodes the given stream using Quoted-Printable. This assumes that stream is text and therefore does not escape all line endings.

Parameters:
in - not null
out - not null
Throws:
java.io.IOException

encodeBase64

public static void encodeBase64(java.io.InputStream in,
                                java.io.OutputStream out)
                         throws java.io.IOException
Encodes the given stream using base64.

Parameters:
in - not null
out - not null
Throws:
java.io.IOException - if an I/O error occurs

wrapQuotedPrintable

public static java.io.OutputStream wrapQuotedPrintable(java.io.OutputStream out,
                                                       boolean binary)
                                                throws java.io.IOException
Wraps the given stream in a Quoted-Printable encoder.

Parameters:
out - not null
Returns:
encoding outputstream
Throws:
java.io.IOException

wrapBase64

public static java.io.OutputStream wrapBase64(java.io.OutputStream out)
                                       throws java.io.IOException
Wraps the given stream in a Base64 encoder.

Parameters:
out - not null
Returns:
encoding outputstream
Throws:
java.io.IOException


Copyright © 2004-2011. All Rights Reserved.