标签:
public byte[] StreamToBytes(Stream stream) { byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, bytes.Length); stream.Seek(0, SeekOrigin.Begin);// 设置当前流的位置为流的开始 return bytes; } public Stream BytesToStream(byte[] bytes) { Stream stream = new MemoryStream(bytes); return stream; }
标签:
原文地址:http://www.cnblogs.com/ilookbo/p/4727663.html