summaryrefslogtreecommitdiff
path: root/mono/DataWrapper.custom
blob: 6365f3de607b9618aa6669e6b4304dba0d97ce13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public StreamWrapper Stream {
	get {
		GMime.Stream gmime_stream = GMimeStream;
		GMime.StreamFilter filtered_stream;
		FilterBasic filter;

		switch (Encoding) {
		case ContentEncoding.QuotedPrintable:
		case ContentEncoding.UuEncode:
		case ContentEncoding.Base64:
			filtered_stream = new GMime.StreamFilter (gmime_stream);
			filter = new FilterBasic (Encoding, false);
			filtered_stream.Add (filter);
			gmime_stream.Dispose ();
			filter.Dispose ();

			gmime_stream = filtered_stream;
			break;
		default:
			break;
		}

		return new StreamWrapper (gmime_stream);
	}
}