<PackageReference Include="System.Data.SqlClient" Version="4.7.0-preview8.19405.3" />

SqlBytes

public sealed class SqlBytes : INullable
Represents a mutable reference type that wraps either a Buffer or a Stream.
public static SqlBytes Null { get; }

Returns a null instance of this SqlBytes.

public byte[] Buffer { get; }

Returns a reference to the internal buffer.

public bool IsNull { get; }

Gets a Boolean value that indicates whether this SqlBytes is null.

public byte this[long offset] { get; set; }

Gets or sets the SqlBytes instance at the specified index.

public long Length { get; }

Gets the length of the value that is contained in the SqlBytes instance.

public long MaxLength { get; }

Gets the maximum length of the value of the internal buffer of this SqlBytes.

public Stream Stream { get; set; }

Gets or sets the data of this SqlBytes as a stream.

public byte[] Value { get; }

Returns a managed copy of the value held by this SqlBytes.

public SqlBytes()

Initializes a new instance of the SqlBytes class.

public SqlBytes(byte[] buffer)

Initializes a new instance of the SqlBytes class based on the specified byte array.

public SqlBytes(SqlBinary value)

Initializes a new instance of the SqlBytes class based on the specified SqlBinary value.

public SqlBytes(Stream s)

Initializes a new instance of the SqlBytes class based on the specified Stream value.

public static SqlBytes op_Explicit(SqlBinary value)

Converts a SqlBinary structure to a SqlBytes structure.

public static SqlBinary op_Explicit(SqlBytes value)

Converts a SqlBytes structure to a SqlBinary structure.

public long Read(long offset, byte[] buffer, int offsetInBuffer, int count)

Copies bytes from this SqlBytes instance to the passed-in buffer and returns the number of copied bytes.

public void SetLength(long value)

Sets the length of this SqlBytes instance.

public void SetNull()

Sets this SqlBytes instance to null.

Constructs and returns a SqlBinary from this SqlBytes instance.

public void Write(long offset, byte[] buffer, int offsetInBuffer, int count)

Copies bytes from the passed-in buffer to this SqlBytes instance.