public byte[] StreamToBytes(Stream stream) { byte[] bytes = new byte[stream.Length]; stream.Read(bytes, , bytes.Length); stream.Seek(, SeekOrigin.Begin);// 设置当前流的位置为流的开始 return bytes; } public Stream BytesToStream(byte[] bytes) { Stream stream = new…