←Select platform

UriOperationBufferSize Property

Summary
Gets or sets the size of the buffer used in URI-based load or information operations.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public int UriOperationBufferSize { get; set; } 
@property (nonatomic, assign) NSUInteger uriOperationBufferSize; 
public int getUriOperationBufferSize() 
public void setUriOperationBufferSize(int value) 
public: 
property int UriOperationBufferSize { 
   int get(); 
   void set (    int ); 
} 
UriOperationBufferSize # get and set (RasterCodecs) 

Property Value

A value specifying the size of the buffer (in bytes) used in streaming operations. The value should be greater or equal to 1. Default value is 4096.

Remarks

The value of the UriOperationBufferSize property is used to determine the size of the temporary buffer used when streaming image file data using any of the URI-based load or information operations.

The following methods use the value of this property internally to allocate the temporary buffer:

The default size of the buffer is 4096 (4 KBytes). This means that the RasterCodecs object will try to load the image data in 4 KBytes chunks of data.

Increasing the buffer size might enhance the performance while also increasing the amount of memory resources used.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
public void LoadUri1Example() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   Uri uri = new Uri(@"https://www.leadtools.com/images/page_graphics/leadlogo.png"); 
   RasterImage image = codecs.Load(uri); 
   codecs.UriOperationBufferSize = 4096; 
 
   // Show information about the image 
   Debug.WriteLine("Size: {0} by {1} pixels", image.Width, image.Height); 
   Debug.WriteLine("Bits/Pixel: {0}", image.BitsPerPixel); 
   image.Dispose(); 
 
   // Clean up 
   codecs.Dispose(); 
} 
 
import java.io.*; 
import java.net.*; 
import java.nio.file.Paths; 
import java.util.*; 
import java.time.Instant; 
import java.time.Duration; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.codecs.RasterCodecs.FeedCallbackThunk; 
import leadtools.drawing.internal.*; 
import leadtools.imageprocessing.*; 
import leadtools.imageprocessing.color.ChangeIntensityCommand; 
import leadtools.svg.*; 
 
 
public void loadUri1Example() throws URISyntaxException { 
   RasterCodecs codecs = new RasterCodecs(); 
   URI uri = new URI("https://www.leadtools.com/images/page_graphics/leadlogo.png"); 
   RasterImage image = codecs.load(uri); 
   codecs.setUriOperationBufferSize(4096); 
 
   // Show information about the image 
   System.out.println("Size: " + image.getWidth() + " by " + image.getHeight() + " pixels"); 
   System.out.println("Bits/Pixel: " + image.getBitsPerPixel()); 
 
   assertTrue("UriOperationBufferSize is incorrect", codecs.getUriOperationBufferSize() == 4096); 
   System.out.println("UriOperationBufferSize has the correct value"); 
 
   // Clean up 
   image.dispose(); 
   codecs.dispose(); 
} 
Requirements

Target Platforms

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

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