CryptoAPITransform.TransformBlock(Byte[], Int32, Int32, Byte[], Int32) 方法

定义

计算输入字节数组的指定区域的转换,并将所得到的转换复制到输出字节数组的指定区域。

public:
 virtual int TransformBlock(cli::array <System::Byte> ^ inputBuffer, int inputOffset, int inputCount, cli::array <System::Byte> ^ outputBuffer, int outputOffset);
public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
abstract member TransformBlock : byte[] * int * int * byte[] * int -> int
override this.TransformBlock : byte[] * int * int * byte[] * int -> int
Public Function TransformBlock (inputBuffer As Byte(), inputOffset As Integer, inputCount As Integer, outputBuffer As Byte(), outputOffset As Integer) As Integer

参数

inputBuffer
Byte[]

对其执行操作的输入。

inputOffset
Int32

输入字节数组中的偏移量,从该位置开始使用数据。

inputCount
Int32

输入字节数组中用作数据的字节数。

outputBuffer
Byte[]

将数据写入的输出。

outputOffset
Int32

输出字节数组中的偏移量,从该位置开始写入数据。

返回

写入的字节数。

实现

例外

inputBuffer 参数为 null

- 或 -

outputBuffer 参数为 null

输入缓冲区的长度小于输入偏移量和输入计数之和。

inputOffset 超出范围。 此参数需要非负数。

示例

下面的代码示例演示如何调用 TransformBlock 方法来转换 数组中的sourceBytes字节currentPosition,并将字节targetBytes写入数组。 此代码示例是为 CryptoAPITransform 类提供的一个更大示例的一部分。

numBytesRead = cryptoTransform->TransformBlock(
   sourceBytes, currentPosition, inputBlockSize,
   targetBytes, currentPosition );
numBytesRead = cryptoTransform.TransformBlock(
    sourceBytes,
    currentPosition,
    inputBlockSize,
    targetBytes,
    currentPosition);
numBytesRead = cryptoTransform.TransformBlock( _
    sourceBytes, _
    currentPosition, _
    inputBlockSize, _
    targetBytes, _
    currentPosition)

适用于

另请参阅