Click or drag to resize

FileStreamExensions.SafeSetLength Method

X#
Sets the length of a stream. Contains TRY CATCH mechanism.

Namespace:  XSharp
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 STATIC METHOD SafeSetLength(
	SELF oStream AS FileStream,
	length AS INT64
) AS LOGIC
Request Example View Source

Parameters

oStream
Type: FileStream
The stream for which to set the lengt.
length
Type: Int64
The new length of the stream. The method checks to see that the location is >= 0.

Return Value

Type: Logic
TRUE when succesfull, FALSE when an exception occurred during reading or when the length < 0

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also