Пример #1
0
        /// <summary>Decodes a sequence of bytes from the specified byte array into the specified character array.</summary>
        /// <returns>The actual number of characters written into <paramref name="chars" />.</returns>
        /// <param name="bytes">The byte array containing the sequence of bytes to decode. </param>
        /// <param name="byteIndex">The index of the first byte to decode. </param>
        /// <param name="byteCount">The number of bytes to decode. </param>
        /// <param name="chars">The character array to contain the resulting set of characters. </param>
        /// <param name="charIndex">The index at which to start writing the resulting set of characters. </param>
        /// <exception cref="T:System.ArgumentNullException">
        ///   <paramref name="bytes" /> is null (Nothing).-or- <paramref name="chars" /> is null (Nothing). </exception>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        ///   <paramref name="byteIndex" /> or <paramref name="byteCount" /> or <paramref name="charIndex" /> is less than zero.-or- <paramref name="byteindex" /> and <paramref name="byteCount" /> do not denote a valid range in <paramref name="bytes" />.-or- <paramref name="charIndex" /> is not a valid index in <paramref name="chars" />. </exception>
        /// <exception cref="T:System.ArgumentException">
        ///   <paramref name="chars" /> does not have enough capacity from <paramref name="charIndex" /> to the end of the array to accommodate the resulting characters. </exception>
        /// <exception cref="T:System.Text.DecoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.DecoderFallback" /> is set to <see cref="T:System.Text.DecoderExceptionFallback" />.</exception>
        /// <filterpriority>1</filterpriority>
        public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
        {
            int num    = 0;
            int result = UTF7Encoding.InternalGetChars(bytes, byteIndex, byteCount, chars, charIndex, ref num);

            if ((num & 67108864) != 0)
            {
                throw new ArgumentException(Encoding._("Arg_InvalidUTF7"), "chars");
            }
            return(result);
        }
Пример #2
0
 public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
 {
     return(UTF7Encoding.InternalGetChars(bytes, byteIndex, byteCount, chars, charIndex, ref this.leftOver));
 }