using System; namespace System.Text { /// Represents a substitute output string that is emitted when the original input byte sequence cannot be decoded. This class cannot be inherited. /// 2 // Token: 0x020005E8 RID: 1512 public sealed class DecoderReplacementFallbackBuffer : DecoderFallbackBuffer { /// Initializes a new instance of the class using the value of a object. /// A object that contains a replacement string. // Token: 0x06003704 RID: 14084 RVA: 0x000BC8E8 File Offset: 0x000BAAE8 public DecoderReplacementFallbackBuffer(DecoderReplacementFallback fallback) { if (fallback == null) { throw new ArgumentNullException("fallback"); } this.replacement = fallback.DefaultString; this.current = 0; } /// Gets the number of characters in the replacement fallback buffer that remain to be processed. /// The number of characters in the replacement fallback buffer that have not yet been processed. /// 1 // Token: 0x17000AC2 RID: 2754 // (get) Token: 0x06003705 RID: 14085 RVA: 0x000BC920 File Offset: 0x000BAB20 public override int Remaining { get { return (!this.fallback_assigned) ? 0 : (this.replacement.Length - this.current); } } /// Prepares the replacement fallback buffer to use the current replacement string. /// true if the replacement string is not empty; false if the replacement string is empty. /// An input byte sequence. This parameter is ignored unless an exception is thrown. /// The index position of the byte in . This parameter is ignored in this operation. /// This method is called again before the method has read all the characters in the replacement fallback buffer. /// 1 // Token: 0x06003706 RID: 14086 RVA: 0x000BC948 File Offset: 0x000BAB48 public override bool Fallback(byte[] bytesUnknown, int index) { if (bytesUnknown == null) { throw new ArgumentNullException("bytesUnknown"); } if (this.fallback_assigned && this.Remaining != 0) { throw new ArgumentException("Reentrant Fallback method invocation occured. It might be because either this FallbackBuffer is incorrectly shared by multiple threads, invoked inside Encoding recursively, or Reset invocation is forgotten."); } if (index < 0 || bytesUnknown.Length < index) { throw new ArgumentOutOfRangeException("index"); } this.fallback_assigned = true; this.current = 0; return this.replacement.Length > 0; } /// Retrieves the next character in the replacement fallback buffer. /// The next character in the replacement fallback buffer. /// 2 // Token: 0x06003707 RID: 14087 RVA: 0x000BC9C0 File Offset: 0x000BABC0 public override char GetNextChar() { if (!this.fallback_assigned) { return '\0'; } if (this.current >= this.replacement.Length) { return '\0'; } return this.replacement[this.current++]; } /// Causes the next call to to access the character position in the replacement fallback buffer prior to the current character position. /// true if the operation was successful; otherwise, false. /// 1 // Token: 0x06003708 RID: 14088 RVA: 0x000BCA10 File Offset: 0x000BAC10 public override bool MovePrevious() { if (this.current == 0) { return false; } this.current--; return true; } /// Initializes all internal state information and data in the object. /// 1 // Token: 0x06003709 RID: 14089 RVA: 0x000BCA30 File Offset: 0x000BAC30 public override void Reset() { this.fallback_assigned = false; this.current = 0; } // Token: 0x04001673 RID: 5747 private bool fallback_assigned; // Token: 0x04001674 RID: 5748 private int current; // Token: 0x04001675 RID: 5749 private string replacement; } }