本文整理汇总了C#中MonoTests.System.Security.Cryptography.DebugStream.Write方法的典型用法代码示例。如果您正苦于以下问题:C# DebugStream.Write方法的具体用法?C# DebugStream.Write怎么用?C# DebugStream.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Security.Cryptography.DebugStream
的用法示例。
在下文中一共展示了DebugStream.Write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NonMultipleOfBlockSize_Decrypt
private byte[] NonMultipleOfBlockSize_Decrypt (ICryptoTransform ct, byte[] data)
{
DebugStream stream = new DebugStream (data);
CryptoStream CryptStream = new CryptoStream (stream, ct, CryptoStreamMode.Read);
int len = 0;
long myLength = 0;
byte[] Buffer = new Byte [1024];
DebugStream fout = new DebugStream ();
// each returned block must be 1023 bytes long
// even if this isn't a multiple of the block size
while ((len = CryptStream.Read (Buffer, 0, 1023)) != 0) {
fout.Write (Buffer, 0, len);
fout.Flush ();
myLength = myLength + len;
}
byte[] result = fout.ToArray ();
CryptStream.Close ();
stream.Close ();
return result;
}