Synchronized Method

Stream.Synchronized Method (Stream)


Creates a thread-safe (synchronized) wrapper around the specified Stream object.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true)]
public static Stream Synchronized(
	Stream stream


Type: System.IO.Stream

The Stream object to synchronize.

Return Value

Type: System.IO.Stream

A thread-safe Stream object.

Exception Condition

stream is null.

This method returns a class that wraps the specified Stream object and restricts access to it from multiple threads. All access to the Stream object will be thread safe.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft