FileStreamExensions.SafeWriteAt Method (FileStream, Int64, Byte, Long) | |
Write data at a location in the file. Makes sure that file locations are >= 0.
Namespace:
XSharp
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax STATIC METHOD SafeWriteAt(
SELF oStream AS FileStream,
pos AS INT64,
buffer AS BYTE[],
length AS LONG
) AS LOGIC
public static bool SafeWriteAt(
this FileStream oStream,
long pos,
byte[] buffer,
int length
)
Request Example
View SourceParameters
- oStream
- Type: FileStream
The stream to write to. - pos
- Type: Int64
Location where to start writing. - buffer
- Type: Byte
Buffer that must be written. - length
- Type: Long
# of bytes to write
Return Value
Type:
LogicTRUE when succesfull, FALSE when an exception occurred or when a parameter was incorrect.
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