When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Namespace: Contracts
Assembly: Contracts (in Contracts.dll)

Public Overrides Sub Write( _ 
ByVal buffer As Byte(), _ 
ByVal offset As Integer, _ 
ByVal count As Integer
)
This language is not supported or no code example is available.
public override void Write( 
byte[] buffer
int offset
int count 
)
This language is not supported or no code example is available.
public:  
void Write( 
array< Byte >^ buffer
int offset
int count 
)
This language is not supported or no code example is available.
public function Write( 
buffer : byte[], 
offset : int
count : int 
);
This language is not supported or no code example is available.

Parameters

buffer
Type: byte[]

An array of bytes. This method copies count bytes from buffer to the current stream.

offset
Type: int

The zero-based byte offset in buffer at which to begin copying bytes to the current stream.

count
Type: int

The number of bytes to be written to the current stream.

Exception type Condition

ObjectDisposedException

Write was called after the stream was closed.

ArgumentNullException

buffer is null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

offset or count is negative.

IOException

An I/O error occured, such as the specified file cannot be found.

NotSupportedException

The stream does not support writing.

ArgumentException

The sum of offset and count is greater than the buffer length.

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1