Edit

Share via


StreamExtensions.Write Method

Definition

Overloads

Write(Stream, ReadOnlySpan<Byte>)
Obsolete.

Writes a sequence of bytes to a given Stream instance.

Write<T>(Stream, T)

Writes a value of a specified type into a target Stream instance.

Write(Stream, ReadOnlySpan<Byte>)

Source:
StreamExtensions.cs
Source:
StreamExtensions.cs

Caution

This API is only available for binary compatibility, but Stream.Write should be used instead.

Writes a sequence of bytes to a given Stream instance.

[System.Obsolete("This API is only available for binary compatibility, but Stream.Write should be used instead.")]
public static void Write(this System.IO.Stream stream, ReadOnlySpan<byte> buffer);
public static void Write(this System.IO.Stream stream, ReadOnlySpan<byte> buffer);
[<System.Obsolete("This API is only available for binary compatibility, but Stream.Write should be used instead.")>]
static member Write : System.IO.Stream * ReadOnlySpan<byte> -> unit
static member Write : System.IO.Stream * ReadOnlySpan<byte> -> unit
<Extension()>
Public Sub Write (stream As Stream, buffer As ReadOnlySpan(Of Byte))

Parameters

stream
Stream

The destination Stream to write data to.

buffer
ReadOnlySpan<Byte>

The source Span<T> to read data from.

Attributes

Applies to

Write<T>(Stream, T)

Source:
StreamExtensions.cs
Source:
StreamExtensions.cs

Writes a value of a specified type into a target Stream instance.

public static void Write<T>(this System.IO.Stream stream, in T value) where T : struct;
static member Write : System.IO.Stream * 'T -> unit (requires 'T : struct)
<Extension()>
Public Sub Write(Of T As Structure) (stream As Stream, ByRef value As T)

Type Parameters

T

The type of value to write.

Parameters

stream
Stream

The target Stream instance to write to.

value
T

The input value to write to stream.

Applies to