在.Net的IO操作中经常会用到Stream和Byte[],有两种形式: 一.Stream->Byte[]: 1.如果Stream的 Length属性可读,非常的简单,代码如下:
2.如果Stream的 Length属性不可读,代码如下: