- NAME
- SYNOPSIS
- DESCRIPTION

- Encoding a stream

- COPYRIGHT
- VERSION

# NAME

GT::Mail::Encoder - MIME Encoder

# SYNOPSIS

            open IN, 'decoded.txt' or die $!;
            open OUT, '>encoded.txt' or die $!;
            if (GT::Mail::Encoder->supported ('7bit')) {
                GT::Mail::Encoder->decode (
                                        debug    => 1,
                                        encoding => '7bit',
                                        in       => \*IN,
                                        out      => sub { print OUT $_[0] }
                                    ) or die $GT::Mail::Encoder::error;
            }
            else {
                die "Unsupported encoding";
            }
            close IN;
            close OUT;

# DESCRIPTION

GT::Mail::Encoder is a MIME Encoder implemented in perl. It will try to use the C extension for encoding Base64. If the extension is not there it will do it in perl (slow!).

## Encoding a stream

The `new()` constructor and the `supported()` class method are the only methods that are public in the interface. The `new()` constructor takes a hash of params. The `supported()` method takes a single string, the name of the encoding you want to encode and returns true if the encoding is supported and false otherwise.

debug

  Set debugging level. 1 or 0.

encoding

  Sets the encoding used to encode.

in

  Set to a file handle or IO handle.

out

  Set to a code reference, the decoded stream will be passed in at the first argument for each chunk encoded.

# COPYRIGHT

Copyright (c) 2004 Gossamer Threads Inc. All Rights Reserved. http://www.gossamer-threads.com/

# VERSION

Revision: $Id: Encoder.pm,v 1.44 2008/10/29 23:31:51 brewt Exp $