StreamExtensionsToArray Method

Converts a stream to array of bytes. If the stream can be sought, its position will be the same as before calling this method.


Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.2.0
public static byte[] ToArray(
	this Stream s


s  Stream
Source stream

Return Value

A byte Array with the stream content.

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).

See Also