EncoderExceptionFallbackBuffer Class

Throws EncoderFallbackException when an input character cannot be converted to an encoded output byte sequence. This class cannot be inherited.

System.Object
  System.Text.EncoderFallbackBuffer
    System.Text.EncoderExceptionFallbackBuffer

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

public sealed class EncoderExceptionFallbackBuffer : EncoderFallbackBuffer

The EncoderExceptionFallbackBuffer type exposes the following members.

  NameDescription
Public methodEncoderExceptionFallbackBufferInitializes a new instance of the EncoderExceptionFallbackBuffer class.
Top

  NameDescription
Public propertyRemainingGets the number of characters in the current EncoderExceptionFallbackBuffer object that remain to be processed. (Overrides EncoderFallbackBuffer.Remaining.)
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodFallback(Char, Int32)Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the character that cannot be converted. (Overrides EncoderFallbackBuffer.Fallback(Char, Int32).)
Public methodFallback(Char, Char, Int32)Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the surrogate pair in the input, and the nominal return value is not used. (Overrides EncoderFallbackBuffer.Fallback(Char, Char, Int32).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetNextCharRetrieves the next character in the exception fallback buffer. (Overrides EncoderFallbackBuffer.GetNextChar().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMovePreviousCauses the next call to the GetNextChar method to access the exception data buffer character position that is prior to the current position. (Overrides EncoderFallbackBuffer.MovePrevious().)
Public methodResetInitializes all data and state information pertaining to this fallback buffer. (Inherited from EncoderFallbackBuffer.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

A common reason for an encoding or decoding operation to fail is if the underlying encoding class does not provide a mapping between a character and an equivalent byte sequence. If the input character cannot be converted to an output byte sequence, the encoding operation calls the Fallback method, which throws EncoderFallbackException.

The System.Text.EncoderFallbackBuffer class, which represents a data buffer used in an encoding operation, is the base class for the EncoderExceptionFallbackBuffer class. However, instead of a data buffer, the EncoderExceptionFallbackBuffer class represents a standard behavior wherein an exception is thrown if an encoding operation fails. No actual data buffer exists, and the members designed to manipulate such a buffer do no significant work.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft