Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Text.​Decoder

Assembly: System.Runtime

Inheritance: object → Decoder

Converts a sequence of encoded bytes into a set of characters.

Properties

Fallback
Gets or sets a <see cref="T:System.Text.DecoderFallback" /> object for the current <see cref="T:System.Text.Decoder" /> object.
FallbackBuffer
Gets the <see cref="T:System.Text.DecoderFallbackBuffer" /> object associated with the current <see cref="T:System.Text.Decoder" /> object.

Methods

public void
Convert​(Byte* bytes, int byteCount, Char* chars, int charCount, bool flush, Int32& bytesUsed, Int32& charsUsed, Boolean& completed)
public void
Convert​(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, int charCount, bool flush, Int32& bytesUsed, Int32& charsUsed, Boolean& completed)
public void
Convert​(ReadOnlySpan`1 bytes, Span`1 chars, bool flush, Int32& bytesUsed, Int32& charsUsed, Boolean& completed)
public int
GetCharCount​(Byte* bytes, int count, bool flush)
bytes A pointer to the first byte to decode.
count The number of bytes to decode.
flush <see langword="true" /> to simulate clearing the internal state of the encoder after the calculation; otherwise, <see langword="false" /> .
Returns The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer.
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. A parameter indicates whether to clear the internal state of the decoder after the calculation.
public int
GetCharCount​(byte[] bytes, int index, int count)
bytes The byte array containing the sequence of bytes to decode.
index The index of the first byte to decode.
count The number of bytes to decode.
Returns The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer.
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
public int
GetCharCount​(byte[] bytes, int index, int count, bool flush)
bytes The byte array containing the sequence of bytes to decode.
index The index of the first byte to decode.
count The number of bytes to decode.
flush <see langword="true" /> to simulate clearing the internal state of the encoder after the calculation; otherwise, <see langword="false" /> .
Returns The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer.
When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. A parameter indicates whether to clear the internal state of the decoder after the calculation.
public int
GetCharCount​(ReadOnlySpan`1 bytes, bool flush)
public int
GetChars​(Byte* bytes, int byteCount, Char* chars, int charCount, bool flush)
bytes A pointer to the first byte to decode.
byteCount The number of bytes to decode.
chars A pointer to the location at which to start writing the resulting set of characters.
charCount The maximum number of characters to write.
flush <see langword="true" /> to clear the internal state of the decoder after the conversion; otherwise, <see langword="false" /> .
Returns The actual number of characters written at the location indicated by the <paramref name="chars" /> parameter.
When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer and any bytes in the internal buffer into a set of characters that are stored starting at the specified character pointer. A parameter indicates whether to clear the internal state of the decoder after the conversion.
public int
GetChars​(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
bytes The byte array containing the sequence of bytes to decode.
byteIndex The index of the first byte to decode.
byteCount The number of bytes to decode.
chars The character array to contain the resulting set of characters.
charIndex The index at which to start writing the resulting set of characters.
Returns The actual number of characters written into <paramref name="chars" /> .
When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any bytes in the internal buffer into the specified character array.
public int
GetChars​(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush)
bytes The byte array containing the sequence of bytes to decode.
byteIndex The index of the first byte to decode.
byteCount The number of bytes to decode.
chars The character array to contain the resulting set of characters.
charIndex The index at which to start writing the resulting set of characters.
flush <see langword="true" /> to clear the internal state of the decoder after the conversion; otherwise, <see langword="false" /> .
Returns The actual number of characters written into the <paramref name="chars" /> parameter.
When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any bytes in the internal buffer into the specified character array. A parameter indicates whether to clear the internal state of the decoder after the conversion.
public int
GetChars​(ReadOnlySpan`1 bytes, Span`1 chars, bool flush)
public void
Reset​()
When overridden in a derived class, sets the decoder back to its initial state.
public bool
Equals​(object obj)
Inherited from object
obj The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .
public string
ToString​()
Inherited from object
Returns A string that represents the current object.
Returns a string that represents the current object.