[C#] 二进制流转化为数组 →→→→→进入此内容的聊天室

来自 , 2019-04-29, 写在 C#, 查看 94 次.
URL http://www.code666.cn/view/06c284d3
  1.     public static byte[] StreamToBytes(Stream stream)
  2.     {
  3.         List<byte> bytes = new List<byte>();
  4.         int temp = stream.ReadByte();
  5.         while (temp != -1)
  6.         {
  7.             bytes.Add((byte)temp);
  8.             temp = stream.ReadByte();
  9.         }
  10.  
  11.         return bytes.ToArray();
  12.     }

回复 "二进制流转化为数组"

这儿你可以回复上面这条便签

captcha