Assembly: mscorlib (in mscorlib.dll)
An Encoder object maintains state information between successive calls to GetBytes so it can correctly encode character sequences that span blocks. A Encoder object also preserves trailing characters at the end of data blocks and uses the trailing characters in the next encoding operation. For example, a data block might end with an unmatched high-surrogate, and the matching low-surrogate might be in the next data block. Therefore, the Decoder and the Encoder classes are useful for network transmission and file operations, because those operations often deal with blocks of data instead of a complete data stream.
Reset clears any state information preserved from the previous call to GetBytes, including trailing characters at the end of the previous data block, such as an unmatched high-surrogate.
Reset is useful if you want to reuse the same encoder even after an exception is thrown by GetBytes or GetByteCount.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.