Xceed .NET Libraries Documentation
GetStreamBufferSize Method (SFtpFile)


Xceed.SSH.Client Assembly > Xceed.SSH.Client Namespace > SFtpFile Class : GetStreamBufferSize Method
A reference to a FileSystemEventsSession object which is responsible for raising all events that occur during the process. Can be null.
A Stream object from which data will be read. Can be null.
A Stream object to which data will be written. Can be null.
A FileSystemItem object into which the file will be copied. Can be null.
Gets a value indicating the recommended buffer size for a stream copy operation.
Syntax
'Declaration
 
Protected Overrides Function GetStreamBufferSize( _

   ByVal session As FileSystemEventsSession, _

   ByVal sourceStream As Stream, _

   ByVal destinationStream As Stream, _

   ByVal destinationFile As FileSystemItem _

) As Integer
'Usage
 
Dim instance As SFtpFile

Dim session As FileSystemEventsSession

Dim sourceStream As Stream

Dim destinationStream As Stream

Dim destinationFile As FileSystemItem

Dim value As Integer

 

value = instance.GetStreamBufferSize(session, sourceStream, destinationStream, destinationFile)
protected override int GetStreamBufferSize( 

   FileSystemEventsSession session,

   Stream sourceStream,

   Stream destinationStream,

   FileSystemItem destinationFile

)

Parameters

session
A reference to a FileSystemEventsSession object which is responsible for raising all events that occur during the process. Can be null.
sourceStream
A Stream object from which data will be read. Can be null.
destinationStream
A Stream object to which data will be written. Can be null.
destinationFile
A FileSystemItem object into which the file will be copied. Can be null.

Return Value

An integer value indicating the recommended buffer size for stream copy operations.
Remarks

Methods like CopyTo, which perform stream copy operations, will call this method to get the buffer size to use.

The returned value will always be greater than zero.

The default implementation of the method uses the value given by AbstractFile.DefaultStreamBufferSize.

Derived types can override this method and provide a value suited to their media and the supplied parameters.

In most cases, it is not necessary to override the default implementation of this method.

Care must be taken when choosing a buffer size value. Too small a size increases the loop count nd the number of function calls, impacting performance. Too large a size can use up memory with no improvements in performance.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFtpFile Class
SFtpFile Members
Base Implementation in GetStreamBufferSize