Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Extensions.ByteArrayExtensions Class Reference

Extension methods for converting byte array to generic objects More...

Static Public Member Functions

static byte[] ToByteArray< T > (this T obj)
 Converts an object to a byte[] More...
 
static T FromByteArray< T > (this byte[] bytes)
 Converts a byte[] into an object More...
 
static string AsString (this byte[] bytes)
 Converts a byte[] into a string More...
 
static byte[] ToBytes (this string s)
 Converts a string into a byte[] More...
 

Detailed Description

Extension methods for converting byte array to generic objects

Member Function Documentation

◆ AsString()

static string Sphyrnidae.Common.Extensions.ByteArrayExtensions.AsString ( this byte[]  bytes)
static

Converts a byte[] into a string

Parameters
bytesThe byte[] being converted
Returns
The string

◆ FromByteArray< T >()

static T Sphyrnidae.Common.Extensions.ByteArrayExtensions.FromByteArray< T > ( this byte[]  bytes)
static

Converts a byte[] into an object

Template Parameters
TThe type of object
Parameters
bytesThe byte[] being converted
Returns
The object (or default)

◆ ToByteArray< T >()

static byte [] Sphyrnidae.Common.Extensions.ByteArrayExtensions.ToByteArray< T > ( this T  obj)
static

Converts an object to a byte[]

Template Parameters
TThe type of object
Parameters
objThe object being converted
Returns
The byte[] (or null)

◆ ToBytes()

static byte [] Sphyrnidae.Common.Extensions.ByteArrayExtensions.ToBytes ( this string  s)
static

Converts a string into a byte[]

Parameters
sThe string being converted
Returns
The byte[]

The documentation for this class was generated from the following file: