当前位置:网站首页>二进制流转换成字节数组
二进制流转换成字节数组
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;
}
边栏推荐
- Reset or clear NET MemoryStream - Reset or Clear . NET MemoryStream
- How to use asp Net MVC identity 2 change password authentication- How To Change Password Validation in ASP. Net MVC Identity 2?
- Andwhere multiple or query ORM conditions in yii2
- [error record] the parameter 'can't have a value of' null 'because of its type, but the im
- Change cell color in Excel using C - cell color changing in Excel using C
- Edit and preview in the back pipe to get the value writing method of the form
- Idea set method call ignore case
- Spark on yarn资源优化思路笔记
- JS finds all the parent nodes or child nodes under a node according to the tree structure
- I2C 子系统(四):I2C debug
猜你喜欢
I2C 子系统(三):I2C Driver
The idea cannot be loaded, and the market solution can be applied (pro test)
Yiwen takes you to know ZigBee
Use of El tree search method
45 lectures on MySQL [index]
docker安装redis
Why does thread crash not cause JVM crash
Creation and destruction of function stack frame
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
I2C 子系统(二):I3C spec
随机推荐
I2C subsystem (II): I3C spec
销毁Session和清空指定的属性
Gavin teacher's perception of transformer live class - rasa project's actual banking financial BOT Intelligent Business Dialogue robot architecture, process and phenomenon decryption through rasa inte
docker安装redis
The base value is too large (the error is marked as "08") [duplicate] - value too great for base (error token is'08') [duplicate]
力扣------网格中的最小路径代价
Idea set method call ignore case
解决高並發下System.currentTimeMillis卡頓
The XML file generated by labelimg is converted to VOC format
Docker install MySQL
45 lectures on MySQL [index]
Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
基于Qt的yolov5工程
从输入URL到页面展示这中间发生了什么?
labelme标记的文件转换为yolov5格式
内存泄漏工具VLD安装及使用
VS 2019配置tensorRT
[error record] the parameter 'can't have a value of' null 'because of its type, but the im
Yiwen takes you to know ZigBee
MySql实战45讲【事务隔离】