Table of Contents

Class BytesExtensions

Namespace
Utils.Objects
Assembly
Utils.dll

Extension methods for creating and concatenating Bytes instances.

public static class BytesExtensions
Inheritance
BytesExtensions
Inherited Members

Methods

AsBytes(byte[])

Creates a Bytes instance that references the specified byteArray without creating an internal copy. (Be careful with mutations!)

public static Bytes AsBytes(this byte[] byteArray)

Parameters

byteArray byte[]

The byte array to wrap in a Bytes.

Returns

Bytes

A Bytes referencing the exact array.

Join(params IEnumerable<byte[]>)

Concatenates all the byte arrays into a single Bytes instance.

public static Bytes Join(params IEnumerable<byte[]> byteArrays)

Parameters

byteArrays IEnumerable<byte[]>

A collection or list of byte arrays to join.

Returns

Bytes

A Bytes that contains all data from byteArrays.

Join(IEnumerable<IEnumerable<byte>>)

Concatenates multiple sequences of bytes into a single Bytes instance.

public static Bytes Join(IEnumerable<IEnumerable<byte>> byteArrays)

Parameters

byteArrays IEnumerable<IEnumerable<byte>>

An enumerable of byte sequences to join.

Returns

Bytes

A Bytes that contains all data from byteArrays.

Join(params IEnumerable<Bytes>)

Concatenates all the Bytes instances into a single Bytes.

public static Bytes Join(params IEnumerable<Bytes> byteArrays)

Parameters

byteArrays IEnumerable<Bytes>

A collection or list of Bytes objects to join.

Returns

Bytes

A Bytes that contains all data.

ToBytes(byte[])

Creates a new Bytes that copies the data from the specified byteArray.

public static Bytes ToBytes(this byte[] byteArray)

Parameters

byteArray byte[]

The byte array to convert.

Returns

Bytes

A Bytes instance containing a copy of byteArray.

ToBytes(IEnumerable<byte>)

Creates a new Bytes that copies the data from the specified enumerable of bytes.

public static Bytes ToBytes(this IEnumerable<byte> byteArray)

Parameters

byteArray IEnumerable<byte>

An enumerable of bytes to convert.

Returns

Bytes

A Bytes instance containing a copy of the data.