CmisSync.Lib.Cmis.ConvenienceExtenders.CmisConvenienceExtenders.AppendContent C# (CSharp) Метод

AppendContent() публичный статический Метод

public static AppendContent ( this doc, string content, bool lastChunk = true ) : IDocument
doc this
content string
lastChunk bool
Результат IDocument
        public static IDocument AppendContent(this IDocument doc, string content, bool lastChunk = true) {
            ContentStream contentStream = new ContentStream();
            contentStream.FileName = doc.Name;
            contentStream.MimeType = MimeType.GetMIMEType(doc.Name);
            byte[] c = Encoding.UTF8.GetBytes(content);
            contentStream.Length = c.LongLength;
            using (var stream = new MemoryStream(c)) {
                contentStream.Stream = stream;
                return doc.AppendContentStream(contentStream, lastChunk);
            }
        }