diff --git a/sources/OpenMcdf/CompoundFile.cs b/sources/OpenMcdf/CompoundFile.cs index aadcc417..31d0f091 100644 --- a/sources/OpenMcdf/CompoundFile.cs +++ b/sources/OpenMcdf/CompoundFile.cs @@ -523,7 +523,7 @@ public void Commit(bool releaseMemory) CheckForLockSector(); sourceStream.Seek(0, SeekOrigin.Begin); - sourceStream.Write((byte[])Array.CreateInstance(typeof(byte), GetSectorSize()), 0, sSize); + sourceStream.Write(new byte[sSize], 0, sSize); CommitDirectory(); @@ -2052,7 +2052,7 @@ public void Save(Stream stream) } } - stream.Write((byte[])Array.CreateInstance(typeof(byte), sSize), 0, sSize); + stream.Write(new byte[sSize], 0, sSize); CommitDirectory();