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

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

返回

写入的字节数。

实现

例外

参数 inputBuffernull.

-或-

参数 outputBuffernull.

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

inputOffset 范围不足。 此参数需要非负数。

示例

下面的代码示例演示如何调用 TransformBlock 方法以转换 currentPosition 数组中的 sourceBytes 字节,并将字节 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)

适用于

另请参阅