Stream.Synchronized Method

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

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

public static Stream Synchronized (
	Stream stream
)
public static Stream Synchronized (
	Stream stream
)
public static function Synchronized (
	stream : Stream
) : Stream
Not applicable.

Parameters

stream

The Stream object to synchronize.

Return Value

A thread-safe Stream object.

Exception typeCondition

ArgumentNullException

stream is a null reference (Nothing in Visual Basic).

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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: