点击或拖拽改变大小

FileStreamExensions.SafeSetLength Method

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

命名空间:  XSharp
程序集:  XSharp.Core (在 XSharp.Core.dll 中) 版本:2.24 GA
Syntax
 STATIC METHOD SafeSetLength(
	SELF oStream AS FileStream,
	length AS INT64
) AS LOGIC
Request Example 查看代码

Parameters

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

Return Value

类型: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