Table of Contents

Class Encoding

Namespace
System.Text
Assembly
nanoFramework.System.Text.dll

Represents a character encoding.

public abstract class Encoding
Inheritance
Encoding
Derived
Inherited Members
Extension Methods

Constructors

Encoding()

protected Encoding()

Properties

UTF8

Gets an encoding for the UTF-8 format.

public static Encoding UTF8 { get; }

Property Value

Encoding

An encoding for the UTF-8 format.

Methods

GetBytes(string)

When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.

public virtual byte[] GetBytes(string s)

Parameters

s string

The string containing the characters to encode.

Returns

byte[]

A byte array containing the results of encoding the specified set of characters.

GetBytes(string, int, int, byte[], int)

When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array.

public virtual int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex)

Parameters

s string

The string containing the set of characters to encode.

charIndex int

The index of the first character to encode.

charCount int

The number of characters to encode.

bytes byte[]

The byte array to contain the resulting sequence of bytes.

byteIndex int

The index at which to start writing the resulting sequence of bytes.

Returns

int

The actual number of bytes written into bytes.

Exceptions

NotImplementedException

GetChars(byte[])

When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters.

public virtual char[] GetChars(byte[] bytes)

Parameters

bytes byte[]

The byte array containing the sequence of bytes to decode.

Returns

char[]

A character array containing the results of decoding the specified sequence of bytes.

Exceptions

NotImplementedException

GetChars(byte[], int, int)

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters.

public virtual char[] GetChars(byte[] bytes, int byteIndex, int byteCount)

Parameters

bytes byte[]

The byte array containing the sequence of bytes to decode.

byteIndex int

The index of the first byte to decode.

byteCount int

The number of bytes to decode.

Returns

char[]

A character array containing the results of decoding the specified sequence of bytes.

Exceptions

NotImplementedException

GetDecoder()

When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters.

public abstract Decoder GetDecoder()

Returns

Decoder

A Decoder that converts an encoded sequence of bytes into a sequence of characters.

GetString(byte[], int, int)

When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a string.

public virtual string GetString(byte[] bytes, int index, int count)

Parameters

bytes byte[]

The byte array containing the sequence of bytes to decode.

index int

The index of the first byte to decode.

count int

The number of bytes to decode.

Returns

string

A string that contains the results of decoding the specified sequence of bytes.