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; }
时间: 2024-10-06 23:00:01