Skip to content

Commit

Permalink
Merge pull request #126 from Numpsy/new_array
Browse files Browse the repository at this point in the history
Is there a need to use Array.CreateInstance(typeof(byte)) to create b…
  • Loading branch information
ironfede authored Aug 3, 2024
2 parents a61b6b9 + c14e848 commit 8276759
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/OpenMcdf/CompoundFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 8276759

Please sign in to comment.