System.Text.EncodingNLS.ThrowBytesOverflow C# (CSharp) Method

ThrowBytesOverflow() private method

private ThrowBytesOverflow ( ) : void
return void
        internal void ThrowBytesOverflow()
        {
            // Special message to include fallback type in case fallback's GetMaxCharCount is broken
            // This happens if user has implemented an encoder fallback with a broken GetMaxCharCount
            throw new ArgumentException(SR.Format(SR.Argument_EncodingConversionOverflowBytes, EncodingName, EncoderFallback.GetType()), "bytes");
        }

Same methods

EncodingNLS::ThrowBytesOverflow ( EncoderNLS encoder, bool nothingEncoded ) : void

Usage Example

示例#1
0
        internal unsafe void MovePrevious(bool bThrow)
        {
            if (fallbackBufferHelper.bFallingBack)
            {
                fallbackBuffer.MovePrevious();                      // don't use last fallback
            }
            else
            {
                Debug.Assert(_chars > _charStart || (bThrow && (_bytes == _byteStart)),
                             "[EncodingByteBuffer.MovePrevious]expected previous data or throw");
                if (_chars > _charStart)
                {
                    _chars--;                                        // don't use last char
                }
            }

            if (bThrow)
            {
                _enc.ThrowBytesOverflow(_encoder, _bytes == _byteStart);    // Throw? (and reset fallback if not converting)
            }
        }