Beispiel #1
0
        private Stream OpenDocumentStream(IDocumentId documentId, FileAccess access, FileShare share)
        {
            GetDocumentInfo(documentId).ContentProvider?.ContentPreparation(documentId.DocumentId);
            var file = File.Open(documentId.DocumentId, FileMode.Open, access, share);

            try
            {
                return(SmartLowMemoryStream.Open(file));
            }
            catch
            {
                file?.Dispose();
                throw;
            }
        }
Beispiel #2
0
 public sealed override void CallOnceContentPreparation(string contentDestinationFilePath)
 {
     using (var contentDestination = SmartLowMemoryStream.Open(contentDestinationFilePath, FileAccess.Write))
         WriteContent(contentDestination);
 }