ASCIIEncoding.GetDecoder 方法

定义

获取可以将 ASCII 编码的字节序列转换为 Unicode 字符序列的解码器。Obtains a decoder that converts an ASCII encoded sequence of bytes into a sequence of Unicode characters.

public:
 override System::Text::Decoder ^ GetDecoder();
public override System.Text.Decoder GetDecoder ();
[System.Runtime.InteropServices.ComVisible(false)]
public override System.Text.Decoder GetDecoder ();
override this.GetDecoder : unit -> System.Text.Decoder
[<System.Runtime.InteropServices.ComVisible(false)>]
override this.GetDecoder : unit -> System.Text.Decoder
Public Overrides Function GetDecoder () As Decoder

返回

Decoder

Decoder 用于将 ASCII 编码的字节序列转换为 Unicode 字符序列。A Decoder that converts an ASCII encoded sequence of bytes into a sequence of Unicode characters.

属性

注解

Decoder.GetChars方法使用类似于此类的方法的方式将连续字节块转换为连续的字符块 GetCharsThe Decoder.GetChars method converts sequential blocks of bytes into sequential blocks of characters, in a manner similar to the GetChars method of this class. 但是, Decoder 会在调用之间维护状态信息,以便能够正确地对跨块的字节序列进行解码。However, a Decoder maintains state information between calls so it can correctly decode byte sequences that span blocks. Decoder还保留数据块末尾的尾随字节,并在下一个解码操作中使用尾随字节。The Decoder also preserves trailing bytes at the end of data blocks and uses the trailing bytes in the next decoding operation. 因此, GetDecoderGetEncoder 对于网络传输和文件操作非常有用,因为这些操作经常处理数据块而不是完整的数据流。Therefore, GetDecoder and GetEncoder are useful for network transmission and file operations, because those operations often deal with blocks of data instead of a complete data stream.

适用于

另请参阅