当前位置:网站首页>二进制流转换成字节数组
二进制流转换成字节数组
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;
}
边栏推荐
- C#通用接口调用
- Segmentation fault occurs during VFORK execution
- open file in 'w' mode: IOError: [Errno 2] No such file or directory
- I2C subsystem (IV): I2C debug
- Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
- 一文带你了解 ZigBee
- 模糊查詢時報錯Parameter index out of range (1 > number of parameters, which is 0)
- How to limit the size of the dictionary- How to limit the size of a dictionary?
- 3D drawing example
- The idea cannot be loaded, and the market solution can be applied (pro test)
猜你喜欢
LVGL使用心得
Left connection, inner connection
Practice of traffic recording and playback in vivo
MySql實戰45講【SQL查詢和更新執行流程】
The process of connecting MySQL with docker
I2C subsystem (IV): I2C debug
Unity3d RPG implementation (medium)
【PyG】理解MessagePassing过程,GCN demo详解
Agile certification (professional scrum Master) simulation exercise-2
Creation and destruction of function stack frame
随机推荐
I2C subsystem (II): I3C spec
JS finds all the parent nodes or child nodes under a node according to the tree structure
labelme标记的文件转换为yolov5格式
I2C 子系統(四):I2C debug
Nasvit: neural architecture search of efficient visual converter with gradient conflict perception hypernetwork training
Sqlserver row to column pivot
Idea set method call ignore case
Process the dataset and use labelencoder to convert all IDs to start from 0
I2C 子系统(三):I2C Driver
[Chongqing Guangdong education] cultural and natural heritage reference materials of China University of Geosciences (Wuhan)
后管中编辑与预览获取表单的值写法
PHP constructor with parameters - PHP constructor with a parameter
Docker install redis
[shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling
Chart. JS multitooltip tag - chart js multiTooltip labels
Destroy the session and empty the specified attributes
[pyg] understand the messagepassing process, GCN demo details
Docker install MySQL
Check log4j problems using stain analysis
node 开启服务器