Class ByteArrayExtensions
Extension methods for byte[] arrays.
Inheritance
System.Object
ByteArrayExtensions
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: GlitchedPolygons.ExtensionMethods
Assembly: UnityScriptsLibrary.dll
Syntax
public static class ByteArrayExtensions
Methods
| Improve this Doc View SourceGetFileSizeString(Byte[])
Gets the byte[] array's human readable file size string (e.g. "5 KB" or "20 MB").
Declaration
public static string GetFileSizeString(this byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | bytes | The bytes (for example a file whose size you want to retrieve in a human readable way). |
Returns
| Type | Description |
|---|---|
| System.String | A human readable file size |
ToBase64String(Byte[], Boolean)
Converts a byte[] array to a Base64-encoded System.String with optional removal of the padding '=' characters.
Declaration
public static string ToBase64String(this byte[] bytes, bool omitPaddingChars = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | bytes | The bytes to encode. |
| System.Boolean | omitPaddingChars | Should the |
Returns
| Type | Description |
|---|---|
| System.String | The Base64-encoded string. |
UTF8GetString(Byte[])
Returns Encoding.UTF8.GetString(byte[]).
Declaration
public static string UTF8GetString(this byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | bytes | The |
Returns
| Type | Description |
|---|---|
| System.String | Returns |