Class BytesExtensions
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
Returns
Join(params IEnumerable<byte[]>)
Concatenates all the byte arrays into a single Bytes instance.
public static Bytes Join(params IEnumerable<byte[]> byteArrays)
Parameters
byteArraysIEnumerable<byte[]>A collection or list of byte arrays to join.
Returns
Join(IEnumerable<IEnumerable<byte>>)
Concatenates multiple sequences of bytes into a single Bytes instance.
public static Bytes Join(IEnumerable<IEnumerable<byte>> byteArrays)
Parameters
byteArraysIEnumerable<IEnumerable<byte>>An enumerable of byte sequences to join.
Returns
Join(params IEnumerable<Bytes>)
public static Bytes Join(params IEnumerable<Bytes> byteArrays)
Parameters
byteArraysIEnumerable<Bytes>A collection or list of Bytes objects to join.
Returns
ToBytes(byte[])
Creates a new Bytes that copies the data from the specified byteArray.
public static Bytes ToBytes(this byte[] byteArray)
Parameters
byteArraybyte[]The byte array to convert.
Returns
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
byteArrayIEnumerable<byte>An enumerable of bytes to convert.