Show / Hide Table of Contents

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 Source

GetFileSizeString(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 string that represents the passed byte[] array's length (string.Empty if the array was null).

| Improve this Doc View Source

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 = padding characters be omitted?

Returns
Type Description
System.String

The Base64-encoded string.

| Improve this Doc View Source

UTF8GetString(Byte[])

Returns Encoding.UTF8.GetString(byte[]).

Declaration
public static string UTF8GetString(this byte[] bytes)
Parameters
Type Name Description
System.Byte[] bytes

The byte[] array to convert.

Returns
Type Description
System.String

Returns Encoding.UTF8.GetString(byte[])

  • Improve this Doc
  • View Source
Back to top Generated by DocFX