当前位置:网站首页>二进制流转换成字节数组
二进制流转换成字节数组
2022-07-03 03:13:00 【yc_1224】
/// <summary>
/// 二进制流转换成字节数组
/// </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;
}
边栏推荐
- Use of El tree search method
- Basic information of Promethus (I)
- Andwhere multiple or query ORM conditions in yii2
- Unity3d RPG implementation (medium)
- Opengauss database development and debugging tool guide
- QT based tensorrt accelerated yolov5
- 模糊查询时报错Parameter index out of range (1 > number of parameters, which is 0)
- MySQL practice 45 [SQL query and update execution process]
- Le processus de connexion mysql avec docker
- C # general interface call
猜你喜欢
![[error record] the parameter 'can't have a value of' null 'because of its type, but the im](/img/1c/46d951e2d0193999f35f14d18a2de0.jpg)
[error record] the parameter 'can't have a value of' null 'because of its type, but the im

Vs 2019 configure tensorrt to generate engine

Docker install redis

C语言初阶-指针详解-庖丁解牛篇

【PyG】理解MessagePassing过程,GCN demo详解

Le processus de connexion mysql avec docker

Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes

MySql实战45讲【行锁】

The idea setting code is in UTF-8 idea Properties configuration file Chinese garbled
![MySQL practice 45 [SQL query and update execution process]](/img/cd/3a635f0c3bb4ac3c8241cb77285cc8.png)
MySQL practice 45 [SQL query and update execution process]
随机推荐
Tensorflow to pytorch notes; tf. gather_ Nd (x, y) to pytorch
MySql实战45讲【行锁】
Le processus de connexion mysql avec docker
docker安装mysql
后管中编辑与预览获取表单的值写法
Vs 2019 configuration du moteur de génération de tensorrt
二维数组中的元素求其存储地址
New programmers use the isXXX form to define Boolean types in the morning, and are discouraged in the afternoon?
How to limit the size of the dictionary- How to limit the size of a dictionary?
模糊查詢時報錯Parameter index out of range (1 > number of parameters, which is 0)
TCP handshake three times and wave four times. Why does TCP need handshake three times and wave four times? TCP connection establishes a failure processing mechanism
Model transformation onnx2engine
Reset or clear NET MemoryStream - Reset or Clear . NET MemoryStream
ComponentScan和ComponentScans的区别
MySQL Real combat 45 [SQL query and Update Execution Process]
一文带你了解 ZigBee
Converts a timestamp to a time in the specified format
idea 加载不了应用市场解决办法(亲测)
Do you really understand relays?
3D drawing example