Table of Contents

Interface IBytes

Namespace
PushTechnology.ClientInterface.Data
Assembly
Diffusion.Client.dll

The read-only interface for values that are internally represented as binary data.

public interface IBytes

Remarks

This interface provides access to copies of the binary data, making instances effectively immutable.

Since: 5.8

Properties

Length

Returns the length of the data in bytes.

int Length { get; }

Property Value

int

The length of the data in bytes.

Methods

AsInputStream()

Returns the data as a read-only stream.

Stream AsInputStream()

Returns

Stream

The read-only stream.

CopyTo(Stream)

Writes the data to an output stream.

void CopyTo(Stream outputStream)

Parameters

outputStream Stream

The target output stream.

Remarks

This method avoids the allocation and copying costs of producing an intermediate byte array using ToByteArray().

Exceptions

ArgumentNullException

outputStream is null.

IOException

An I/O error occurs.

NotSupportedException

The outputStream stream does not support writing, or the stream is already closed.

ObjectDisposedException

Methods were called after the outputStream stream was closed.

ToByteArray()

Returns a copy of the data as a byte array.

byte[] ToByteArray()

Returns

byte[]

The copy of the binary data.