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.

Definition

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

Parameters

s  Stream
Source stream

Return Value

Byte
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