/// <summary>Converts the specified region of the specified byte array to base 64.</summary> /// <returns>The computed base 64 conversion.</returns> /// <param name="inputBuffer">The input to convert to base 64. </param> /// <param name="inputOffset">The offset into the byte array from which to begin using data. </param> /// <param name="inputCount">The number of bytes in the byte array to use as data. </param> /// <exception cref="T:System.ObjectDisposedException">The current <see cref="T:System.Security.Cryptography.ToBase64Transform" /> object has already been disposed. </exception> /// <exception cref="T:System.ArgumentException">The <paramref name="inputBuffer" /> parameter contains an invalid offset length.-or-The <paramref name="inputCount" /> parameter contains an invalid value.</exception> /// <exception cref="T:System.ArgumentNullException">The <paramref name="inputBuffer" /> parameter is null.</exception> /// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="inputBuffer" /> parameter requires a non-negative number.</exception> public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) { if (this.m_disposed) { throw new ObjectDisposedException("TransformFinalBlock"); } if (inputBuffer == null) { throw new ArgumentNullException("inputBuffer"); } if (inputCount < 0) { throw new ArgumentException("inputCount", "< 0"); } if (inputOffset > inputBuffer.Length - inputCount) { throw new ArgumentException("inputCount", Locale.GetText("Overflow")); } if (inputCount > this.InputBlockSize) { throw new ArgumentOutOfRangeException(Locale.GetText("Invalid input length")); } return(ToBase64Transform.InternalTransformFinalBlock(inputBuffer, inputOffset, inputCount)); }