Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Stream.Synchronized(Stream) Method

Definition

Namespace:
System.IO
Assemblies:
netstandard.dll, System.Runtime.dll
Assembly:
System.Runtime.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
Stream.cs
Source:
Stream.cs
Source:
Stream.cs
Source:
Stream.cs
Source:
Stream.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public:
 static System::IO::Stream ^ Synchronized(System::IO::Stream ^ stream);
public static System.IO.Stream Synchronized(System.IO.Stream stream);
static member Synchronized : System.IO.Stream -> System.IO.Stream
Public Shared Function Synchronized (stream As Stream) As Stream

Parameters

stream
Stream

The Stream object to synchronize.

Returns

A thread-safe Stream object.

Exceptions

stream is null.

Remarks

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.

Applies to


Feedback

Was this page helpful?