当前位置: 首页>>代码示例>>C#>>正文


C# Stream.ToBytes方法代码示例

本文整理汇总了C#中System.IO.Stream.ToBytes方法的典型用法代码示例。如果您正苦于以下问题:C# Stream.ToBytes方法的具体用法?C# Stream.ToBytes怎么用?C# Stream.ToBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.Stream的用法示例。


在下文中一共展示了Stream.ToBytes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveBlob

 public void SaveBlob(string container, string key, Stream bloblStream)
 {
     lock (_lockObject)
         GetBlob(container).AddOrReplace(key, bloblStream.ToBytes());
 }
开发者ID:Arkadiy94,项目名称:CommonLibraries,代码行数:5,代码来源:AzureBlobInMemory.cs

示例2: EncryptStream

 /// <summary>
 /// 대칭형 암호화 알고리즘을 이용하여, <paramref name="plainStream"/>을 암호화하여 스트림으로 반환합니다.
 /// </summary>
 /// <param name="encryptor">대칭형 암호화 인스턴스</param>
 /// <param name="plainStream">원본 스트림</param>
 /// <returns>암호화된 스트림</returns>
 public static Stream EncryptStream(this ISymmetricEncryptor encryptor, Stream plainStream) {
     plainStream.ShouldNotBeNull("plainStream");
     return new MemoryStream(encryptor.Encrypt(plainStream.ToBytes()));
 }
开发者ID:debop,项目名称:NFramework,代码行数:10,代码来源:CryptoTool.Convert.cs

示例3: DecryptStream

 /// <summary>
 /// 암호화된 스트림을 복원합니다.
 /// </summary>
 /// <param name="encryptor"></param>
 /// <param name="stream"></param>
 /// <returns></returns>
 public static Stream DecryptStream(this ISymmetricEncryptor encryptor, Stream stream) {
     return new MemoryStream(encryptor.Decrypt(stream.ToBytes()));
 }
开发者ID:debop,项目名称:NFramework,代码行数:9,代码来源:SymmetricEncryptorEx.cs

示例4: DecryptString

 /// <summary>
 /// 대칭형 암호화 알고리즘을 이용하여, <paramref name="cipherStream"/>을 복호화한 스트림을 반환합니다.
 /// </summary>
 /// <param name="encryptor">대칭형 암호화 인스턴스</param>
 /// <param name="cipherStream">암호화된 정보를 가진 스트림</param>
 /// <returns>복호화된 정보를 가진 스트림</returns>
 public static Stream DecryptString(this ISymmetricEncryptor encryptor, Stream cipherStream) {
     cipherStream.ShouldNotBeNull("cipherStream");
     return new MemoryStream(encryptor.Decrypt(cipherStream.ToBytes()));
 }
开发者ID:debop,项目名称:NFramework,代码行数:10,代码来源:CryptoTool.Convert.cs

示例5: CompressStream

 /// <summary>
 /// 스트림을 압축한다.
 /// </summary>
 /// <param name="compressor"><see cref="ICompressor"/> 구현 객체</param>
 /// <param name="stream">압축할 <see cref="Stream"/></param>
 /// <returns>압축된 <see cref="MemoryStream"/></returns>
 public static Stream CompressStream(this ICompressor compressor, Stream stream) {
     return new MemoryStream(compressor.Compress(stream.ToBytes()));
 }
开发者ID:debop,项目名称:NFramework,代码行数:9,代码来源:CompressorEx.cs


注:本文中的System.IO.Stream.ToBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。