public ImapLiteral (FormatOptions options, object literal, Action<int> action = null)
{
format = options.Clone ();
format.NewLineFormat = NewLineFormat.Dos;
update = action;
if (literal is MimeMessage) {
Type = ImapLiteralType.MimeMessage;
} else if (literal is Stream) {
Type = ImapLiteralType.Stream;
} else if (literal is string) {
literal = Encoding.UTF8.GetBytes ((string) literal);
Type = ImapLiteralType.String;
} else if (literal is byte[]) {
Type = ImapLiteralType.String;
} else {
throw new ArgumentException ("Unknown literal type");
}
Literal = literal;
}