diff --git a/main/POIFS/NIO/FileBackedDataSource.cs b/main/POIFS/NIO/FileBackedDataSource.cs index 2219e4d24..92fc61971 100644 --- a/main/POIFS/NIO/FileBackedDataSource.cs +++ b/main/POIFS/NIO/FileBackedDataSource.cs @@ -169,7 +169,8 @@ public override void CopyTo(Stream stream) { //byte[] tempBuffer = new byte[stream.Length]; //fileStream.Read(tempBuffer, 0, tempBuffer.Length); - stream.Write(fileStream.GetBuffer(), 0, (int)fileStream.Length); } + byte[] tempBuffer = fileStream.ToArray(); + stream.Write(tempBuffer, 0, tempBuffer.Length); } public override long Size {