←Select platform

Stream Property

Summary
Gets the System.IO.Stream that contains the downloaded item data (buffer).

Syntax
C#
C++/CLI
Python
public Stream Stream { get; } 
public: 
property Stream^ Stream { 
   Stream^ get(); 
} 

Property Value

A System.IO.Stream that contains the downloaded item data (buffer).

Remarks

In most cases, the stream is an HTTP stream and the Stream.CanSeek value will be set to false. Hence, you should read the data from the stream in a forward direction only. Also, do not make any assumptions regarding the stream length as shown in the examples.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.SharePoint.Client; 
 
 
public void SharePointClientDownloadStreamExample() 
{ 
   // Replace SHAREPOINT_SITE_URI with a valid URL to a SharePoint site, for example 
   // http://SiteCollection/MySite 
   Uri siteUri = new Uri(SHAREPOINT_SITE_URI); 
 
   // Replace SHAREPOINT_FOLDER_NAME with a valid folder on the site above, for example 
   // "Documents" or "Documents\Sub Documents" 
   string folderName = SHAREPOINT_FOLDER_NAME; 
 
   // Replace SHAREPOINT_DOCUMENT_NAME with a valid document on the folder above, for example 
   // MyDocument.tif 
   string documentName = SHAREPOINT_DOCUMENT_NAME; 
 
   // Build the full URL to the document are we going to download 
   UriBuilder builder = new UriBuilder(siteUri); 
   builder.Path = Path.Combine(builder.Path, folderName); 
   builder.Path = Path.Combine(builder.Path, documentName); 
   Uri sourceDocumentUri = builder.Uri; 
 
   SharePointClient spClient = new SharePointClient(); 
 
   // Optional: Set the credentials: 
   spClient.Credentials = new NetworkCredential(USER_NAME, PASSWORD, DOMAIN); 
 
   // Get the stream to the SharePoint item 
   using (SharePointClientDownloadData data = spClient.GetDownloadStream(sourceDocumentUri)) 
   { 
      // Use RasterCodecs to get its information 
      using (RasterCodecs codecs = new RasterCodecs()) 
      { 
         using (CodecsImageInfo imageInfo = codecs.GetInformation(data.Stream, true)) 
         { 
            // Show the image info 
            Console.WriteLine("URL:        {0}", sourceDocumentUri); 
            Console.WriteLine("Pages:      {0}", imageInfo.TotalPages); 
            Console.WriteLine("Size:       {0} by {1} pixels", imageInfo.Width, imageInfo.Height); 
            Console.WriteLine("Resolution: {0} by {1} dpi", imageInfo.XResolution, imageInfo.YResolution); 
            Console.WriteLine("Bits/Pixel: {0}", imageInfo.BitsPerPixel); 
         } 
      } 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.