public byte[] StreamToBytes(Stream stream)
{
byte[] bytes = new byte[stream.Length];
stream.Read(bytes, 0, bytes.Length);
stream.Seek(0, SeekOrigin.Begin);
return bytes;
} public Stream BytesToStream(byte[] bytes)
{
Stream stream = new MemoryStream(bytes);
return stream;
}
相关文章
- [视频转换] C#VideoConvert视频转换帮助类 (转载)
- HttpServletRequest 转换成MultipartHttpServletRequest
- c/c++强制类型转换
- 重新想象 Windows 8 Store Apps (52) - 绑定: 与 Element Model Indexer Style RelativeSource 绑定, 以及绑定中的数据转换
- JSON和JAVA的POJO的相互转换【转载】
- 数据结构Java实现06----中缀表达式转换为后缀表达式
- NSString、NSData、char* 类型之间的转换-备
- c++构造函数隐式转换--转换构造函数
- VMM应用指南之11-将虚拟机转换为模板
- 微信小程序安装实时less转换为wxss的插件使用方法