Encoder Filter Class
A filter for encoding 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 EncoderFilter : MimeFilterBase- Inheritance
- Object MimeFilterBase EncoderFilter
Remarks
Uses a IMimeEncoder to incrementally encode data.
Example
C#
public static void Base64EncodeFile (string inputFileName, string outputFileName)
{
using (var input = File.OpenRead (inputFileName)) {
using (var output = File.Create (outputFileName)) {
// A FilteredStream passes all data that is written to (or read from) it through
// each of its filters, in the order that the filters were added.
using (var filtered = new FilteredStream (output)) {
filtered.Add (EncoderFilter.Create (ContentEncoding.Base64));
input.CopyTo (filtered);
// Flush the filtered stream so that the encoder writes out any remaining
// buffered data to the output stream.
filtered.Flush ();
}
}
}
}
Constructors
| EncoderFilter | Initialize a new instance of the EncoderFilter class. |
Properties
| Encoder | Get the encoder used by this filter. |
| Encoding | Get the encoding. |
| OutputBuffer |
Get the output buffer.
(Inherited from MimeFilterBase) |
Methods
| Create(ContentEncoding, Int32) | Create a filter that will encode using specified encoding. |
| Create(String, Int32) | Create a filter that will encode using specified encoding. |
| Create(ContentEncoding, NewLineFormat, Int32) | Create a filter that will encode using the specified encoding and line endings. |
| Create(String, NewLineFormat, Int32) | Create a filter that will encode using the specified encoding and line endings. |
| 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) |