Decoder Filter Class
A filter for decoding MIME content.
Definition
Namespace: MimeKit.IO.Filters
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public class DecoderFilter : MimeFilterBase- Inheritance
- Object MimeFilterBase DecoderFilter
Remarks
Uses a IMimeDecoder to incrementally decode data.
Example
C#
public static void DecodeFile (string inputFileName, string outputFileName, string contentTransferEncoding)
{
using (var input = File.OpenRead (inputFileName)) {
// Filters can also be used when reading from a FilteredStream. Here, the source stream
// is the encoded input and reading from the filtered stream yields the decoded content.
using (var filtered = new FilteredStream (input)) {
// Create a decoder for the encoding by name, such as "base64" or "quoted-printable".
filtered.Add (DecoderFilter.Create (contentTransferEncoding));
using (var output = File.Create (outputFileName))
filtered.CopyTo (output);
}
}
}
Constructors
| DecoderFilter | Initialize a new instance of the DecoderFilter class. |
Properties
| Decoder | Get the decoder used by this filter. |
| Encoding | Get the encoding. |
| OutputBuffer |
Get the output buffer.
(Inherited from MimeFilterBase) |
Methods
| Create(ContentEncoding) | Create a filter that will decode the specified encoding. |
| Create(String) | Create a filter that will decode the specified encoding. |
| EnsureOutputSize |
Ensure that the output buffer is greater than or equal to the specified size.
(Inherited from MimeFilterBase) |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Filter(Byte, Int32, Int32, Int32, Int32) |
Filter the specified input.
(Inherited from MimeFilterBase) |
| Filter(Byte, Int32, Int32, Int32, Int32, Boolean) |
Filter the specified input.
(Overrides MimeFilterBaseFilter(Byte, Int32, Int32, Int32, Int32, Boolean)) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| Flush |
Filter the specified input, flushing all internally buffered data to the output.
(Inherited from MimeFilterBase) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| Reset |
Reset the filter.
(Overrides MimeFilterBaseReset) |
| SaveRemainingInput |
Save the remaining input for the next round of processing.
(Inherited from MimeFilterBase) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |