Skip to content

Commit

Permalink
Is there a need to use Array.CreateInstance(typeof(byte)) to create b…
Browse files Browse the repository at this point in the history
…yte arrays?
  • Loading branch information
Numpsy committed Apr 8, 2024
1 parent c58985f commit c14e848
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 c14e848

Please sign in to comment.