Class ByteToString
Helper class for converting byte array to string and vice versa.
Inheritance
System.Object
ByteToString
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.Common
Assembly: Cosmos.Common.dll
Syntax
public static class ByteToString
Methods
| Improve this Doc View SourceByteArrToString(Byte[])
Parse byte array to string. To be used on byte arrays created by StrToByteArray method.
Declaration
public static string ByteArrToString(byte[] byteArr)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | byteArr | A byte array to be converted to string. |
Returns
Type | Description |
---|---|
System.String | String value. |
StrToByteArray(String)
Parse numeric (positive) string to byte array.
Declaration
public static byte[] StrToByteArray(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | A string to be converted to byte array. |
Returns
Type | Description |
---|---|
System.Byte[] | Byte array. |
Exceptions
Type | Condition |
---|---|
System.Exception | thrown when the passed string length is 0, string length is not divisible by 3 or the string not numeric |