Class Utf8
UTF-8 encoding/decoding utility.
Inheritance
System.Object
Utf8
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.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class Utf8
Methods
Decode(DataBuffer)
Decodes a UTF-8 data buffer to a string.
Declaration
public static string Decode(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The input byte array. |
Returns
Type | Description |
---|---|
System.String |
Decode(Byte[])
Decodes a UTF-8 byte array to a string.
Declaration
public static string Decode(byte[] input)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
Returns
Type | Description |
---|---|
System.String |
Decode(Byte[], Int32, Int32)
Decodes a UTF-8 byte array to a string.
Declaration
public static string Decode(byte[] input, int index, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | input | The input byte array. |
System.Int32 | index | The index to start reading. |
System.Int32 | length | The length. |
Returns
Type | Description |
---|---|
System.String |
Encode(String)
Encodes a string to a UTF-8 byte array.
Declaration
public static byte[] Encode(string input)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | The input string. |
Returns
Type | Description |
---|---|
System.Byte[] |
GetByteCount(String)
Gets the number of bytes that would be returned by a call to encode.
Declaration
public static int GetByteCount(string input)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | The input string. |
Returns
Type | Description |
---|---|
System.Int32 |