当前位置:网站首页>Convert binary stream to byte array
Convert binary stream to byte array
2022-07-03 03:15:00 【yc_ one thousand two hundred and twenty-four】
/// <summary>
/// Convert binary stream to byte array
/// </summary>
/// <param name="_stream"></param>
/// <returns></returns>
private byte[] StreamtoBytes(Stream _stream)
{
byte[] buff;
int rlen;
MemoryStream _ms;
if (_stream != null)
{
buff = new byte[1024];
rlen = 0;
_ms = new MemoryStream();
while ((rlen = _stream.Read(buff, 0, 1024)) > 0)
{
_ms.Write(buff, 0, rlen);
}
buff = _ms.ToArray();
_ms.Close();
_ms.Dispose();
return buff;
}
return null;
}
边栏推荐
- The idea cannot be loaded, and the market solution can be applied (pro test)
- I2C subsystem (II): I3C spec
- 模型转换onnx2engine
- Yolov5 project based on QT
- VS 2019 配置tensorRT生成engine
- docker安装redis
- 为什么线程崩溃不会导致 JVM 崩溃
- Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
- [error record] the parameter 'can't have a value of' null 'because of its type, but the im
- 模糊查詢時報錯Parameter index out of range (1 > number of parameters, which is 0)
猜你喜欢
![[pyg] understand the messagepassing process, GCN demo details](/img/8b/8490aac98fd2753e661f74e284f43d.png)
[pyg] understand the messagepassing process, GCN demo details
![MySQL Real combat 45 [SQL query and Update Execution Process]](/img/cd/3a635f0c3bb4ac3c8241cb77285cc8.png)
MySQL Real combat 45 [SQL query and Update Execution Process]

Spark on yarn resource optimization ideas notes

Use of El tree search method

3D drawing example

MySql实战45讲【事务隔离】

The idea cannot be loaded, and the market solution can be applied (pro test)

Docker install MySQL

Limit of one question per day

MySql實戰45講【SQL查詢和更新執行流程】
随机推荐
MySQL practice 45 [SQL query and update execution process]
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
3D drawing example
[mathematical logic] normal form (conjunctive normal form | disjunctive normal form | major item | minor item | maximal item | minor item | principal conjunctive normal form | principal disjunctive no
labelme标记的文件转换为yolov5格式
VS 2019 配置tensorRT生成engine
模糊查询时报错Parameter index out of range (1 > number of parameters, which is 0)
Hi3536C V100R001C02SPC040 交叉编译器安装
MySql实战45讲【全局锁和表锁】
你真的懂继电器吗?
模型转换onnx2engine
Unity3d RPG implementation (medium)
open file in 'w' mode: IOError: [Errno 2] No such file or directory
The series of hyperbolic function in daily problem
后管中编辑与预览获取表单的值写法
MySql实战45讲【事务隔离】
二维数组中的元素求其存储地址
C#通用接口调用
The difference between componentscan and componentscans
Pytorch配置