StreamExtensionIsUtf8Valid Method
Tests whether the byte sequence of
stream that starts
with the current
Position and is at least
count characters long is valid UTF-8.
Namespace: FolkerKinzel.StringsAssembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
public static bool IsUtf8Valid(
this Stream stream,
int count = -1,
bool leaveOpen = false
)
<ExtensionAttribute>
Public Shared Function IsUtf8Valid (
stream As Stream,
Optional count As Integer = -1,
Optional leaveOpen As Boolean = false
) As Boolean
public:
[ExtensionAttribute]
static bool IsUtf8Valid(
Stream^ stream,
int count = -1,
bool leaveOpen = false
)
[<ExtensionAttribute>]
static member IsUtf8Valid :
stream : Stream *
?count : int *
?leaveOpen : bool
(* Defaults:
let _count = defaultArg count -1
let _leaveOpen = defaultArg leaveOpen false
*)
-> bool
- stream Stream
- The Stream to test.
- count Int32 (Optional)
- The minimum number of characters to check. If a negative number
is passed to the parameter (default) or if count is greater than
the length of the data in stream, stream
is checked beginning from its current Position until EOF. The
value 0 is not allowed.
- leaveOpen Boolean (Optional)
- true to leave the stream open after the method has
finished; otherwise, false.
Booleantrue if the checked stream section represents valid UTF-8,
false
otherwise.In Visual Basic and C#, you can call this method as an instance method on any object of type
Stream. 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).