添加几个参数

This commit is contained in:
艾竹
2023-09-03 16:48:56 +08:00
parent b83f4fad7f
commit 2f12bfa829
3 changed files with 13 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
@@ -316,5 +317,15 @@ namespace AIStudio.Wpf.DiagramDesigner
return null;
}
}
public static Stream CopyStream(this Stream stream)
{
byte[] bytearray = new byte[stream.Length];
stream.Seek(0, SeekOrigin.Begin);
stream.Read(bytearray, 0, bytearray.Length);
var destination = new MemoryStream(bytearray);
return destination;
}
}
}