当前位置:网站首页>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;
}
边栏推荐
- Sous - système I2C (IV): débogage I2C
- Andwhere multiple or query ORM conditions in yii2
- Pytorch轻量级可视化工具wandb(local)
- Change cell color in Excel using C - cell color changing in Excel using C
- MySql实战45讲【SQL查询和更新执行流程】
- Vs 2019 configuration du moteur de génération de tensorrt
- 【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(一)
- Update and return document in mongodb - update and return document in mongodb
- MySql實戰45講【SQL查詢和更新執行流程】
- 从输入URL到页面展示这中间发生了什么?
猜你喜欢

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

The process of connecting MySQL with docker

Segmentation fault occurs during VFORK execution

3D drawing example

Spark on yarn资源优化思路笔记

VS 2019安装及配置opencv

Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception

一文带你了解 ZigBee

From C to capable -- use the pointer as a function parameter to find out whether the string is a palindrome character

Vs 2019 configuration tensorrt
随机推荐
umi 路由拦截(简单粗暴)
基于QT的tensorRT加速的yolov5
[pyg] understand the messagepassing process, GCN demo details
VS 2019安装及配置opencv
Vs 2019 configuration du moteur de génération de tensorrt
Edit and preview in the back pipe to get the value writing method of the form
MySQL practice 45 lecture [row lock]
About HTTP cache control
Yiwen takes you to know ZigBee
函数栈帧的创建与销毁
二维数组中的元素求其存储地址
45 lectures on MySQL [index]
PAT乙级“1104 天长地久”DFS优化思路
C language beginner level - pointer explanation - paoding jieniu chapter
Use of El tree search method
VS code配置虚拟环境
[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
On the adjacency matrix and adjacency table of graph storage
com. fasterxml. jackson. databind. Exc.invalidformatexception problem
labelimg生成的xml文件转换为voc格式