我已经在内存流中写入excel数据以实现我的功能之一。现在,我希望将内存流中的数据导入到新的excel工作表中。请提出如何实现此目的。
public static byte[] chunk(byte[] incomingArray)
{
int chunkSize = 32768;
byte[] outboundBuffer = new byte[chunkSize];
int incomingOffset = 0;
using (MemoryStream ms1 = new MemoryStream())
{
while (incomingOffset < incomingArray.Length)
{
int length =
Math.Min(outboundBuffer.Length, incomingArray.Length - incomingOffset);
Buffer.BlockCopy(incomingArray, incomingOffset,
outboundBuffer, 0,
length);
ms1.Write(outboundBuffer, 0, length);
incomingOffset += length;
}
return ms1.ToArray();
}
}