System.Xml.XmlBaseWriter.WriteBase64Async C# (CSharp) Méthode

WriteBase64Async() public méthode

public WriteBase64Async ( byte buffer, int offset, int count ) : System.Threading.Tasks.Task
buffer byte
offset int
count int
Résultat System.Threading.Tasks.Task
        public override Task WriteBase64Async(byte[] buffer, int offset, int count)
        {
            if (IsClosed)
                ThrowClosed();

            if (buffer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(buffer)));

            // Not checking upper bound because it will be caught by "count".  This is what XmlTextWriter does.
            if (offset < 0)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.ValueMustBeNonNegative)));

            if (count < 0)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.ValueMustBeNonNegative)));
            if (count > buffer.Length - offset)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)));

            return WriteBase64AsyncImpl(buffer, offset, count);
        }