FileIOExtensionsPositionOf Method |
Searches a binary stream for a given byte sequence.
Namespace: Altaxo.SerializationAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntaxpublic static long PositionOf(
this Stream stream,
ReadOnlySpan<byte> sequence
)
Parameters
- stream Stream
- The stream.
- sequence ReadOnlySpanByte
- The searched sequence.
Return Value
Int64When the sequence is found, it returns the position in the stream where the sequence starts; if the sequence was not found, -1 is returned.
Usage Note
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).
Exceptions
See Also