class Encoder

in global :: System . Text

Converts a set of characters into a sequence of bytes.


public void Convert( char* chars, int charCount, byte* bytes, int byteCount, bool flush, ref int charsUsed, ref int bytesUsed, ref bool completed )

Converts a buffer of Unicode characters to an encoded byte sequence and stores the result in another buffer.

  • chars The address of a string of UTF-16 encoded characters to convert.
  • charCount The number of characters in to convert.
  • bytes The address of a buffer to store the converted bytes.
  • byteCount The maximum number of bytes in to use in the conversion.
  • flush to indicate no further data is to be converted; otherwise, .
  • charsUsed When this method returns, contains the number of characters from that were used in the conversion. This parameter is passed uninitialized.
  • bytesUsed When this method returns, contains the number of bytes that were used in the conversion. This parameter is passed uninitialized.
  • completed When this method returns, contains if all the characters specified by were converted; otherwise, . This parameter is passed uninitialized.

public void Convert( char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, int byteCount, bool flush, ref int charsUsed, ref int bytesUsed, ref bool completed )

Converts an array of Unicode characters to an encoded byte sequence and stores the result in an array of bytes.

  • chars An array of characters to convert.
  • charIndex The first element of to convert.
  • charCount The number of elements of to convert.
  • bytes An array where the converted bytes are stored.
  • byteIndex The first element of in which data is stored.
  • byteCount The maximum number of elements of to use in the conversion.
  • flush to indicate no further data is to be converted; otherwise, .
  • charsUsed When this method returns, contains the number of characters from that were used in the conversion. This parameter is passed uninitialized.
  • bytesUsed When this method returns, contains the number of bytes that were produced by the conversion. This parameter is passed uninitialized.
  • completed When this method returns, contains if all the characters specified by were converted; otherwise, . This parameter is passed uninitialized.

public EncoderFallback Fallback { get; set; }

Gets or sets a object for the current object.

  • Returns A object.

public EncoderFallbackBuffer FallbackBuffer { get; }

Gets the object associated with the current object.

  • Returns A object.

public int GetByteCount( char* chars, int count, bool flush )

When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. A parameter indicates whether to clear the internal state of the encoder after the calculation.

  • chars A pointer to the first character to encode.
  • count The number of characters to encode.
  • flush to simulate clearing the internal state of the encoder after the calculation; otherwise, .
  • Returns The number of bytes produced by encoding the specified characters and any characters in the internal buffer.

public int GetByteCount( char[] chars, int index, int count, bool flush )

When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array. A parameter indicates whether to clear the internal state of the encoder after the calculation.

  • chars The character array containing the set of characters to encode.
  • index The index of the first character to encode.
  • count The number of characters to encode.
  • flush to simulate clearing the internal state of the encoder after the calculation; otherwise, .
  • Returns The number of bytes produced by encoding the specified characters and any characters in the internal buffer.

public int GetBytes( char* chars, int charCount, byte* bytes, int byteCount, bool flush )

When overridden in a derived class, encodes a set of characters starting at the specified character pointer and any characters in the internal buffer into a sequence of bytes that are stored starting at the specified byte pointer. A parameter indicates whether to clear the internal state of the encoder after the conversion.

  • chars A pointer to the first character to encode.
  • charCount The number of characters to encode.
  • bytes A pointer to the location at which to start writing the resulting sequence of bytes.
  • byteCount The maximum number of bytes to write.
  • flush to clear the internal state of the encoder after the conversion; otherwise, .
  • Returns The actual number of bytes written at the location indicated by the parameter.

public int GetBytes( char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush )

When overridden in a derived class, encodes a set of characters from the specified character array and any characters in the internal buffer into the specified byte array. A parameter indicates whether to clear the internal state of the encoder after the conversion.

  • chars The character array containing the set of characters to encode.
  • charIndex The index of the first character to encode.
  • charCount The number of characters to encode.
  • bytes The byte array to contain the resulting sequence of bytes.
  • byteIndex The index at which to start writing the resulting sequence of bytes.
  • flush to clear the internal state of the encoder after the conversion; otherwise, .
  • Returns The actual number of bytes written into .

public void Reset( )

😔 No documentation found.

public int GetByteCount( ReadOnlySpan<char> chars, bool flush )

😔 No documentation found.

public int GetBytes( ReadOnlySpan<char> chars, Span<byte> bytes, bool flush )

😔 No documentation found.

public void Convert( ReadOnlySpan<char> chars, Span<byte> bytes, bool flush, ref int charsUsed, ref int bytesUsed, ref bool completed )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.