mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Clean up based on .NET Core 3.1 reccomendations
This commit is contained in:
@@ -227,12 +227,11 @@ namespace SabreTools.FileTypes.Archives
|
||||
if (this.AvailableHashes == Hash.CRC)
|
||||
{
|
||||
gzipEntryRom.Filename = gamename;
|
||||
using (BinaryReader br = new BinaryReader(File.OpenRead(this.Filename)))
|
||||
{
|
||||
br.BaseStream.Seek(-8, SeekOrigin.End);
|
||||
gzipEntryRom.CRC = br.ReadBytesBigEndian(4);
|
||||
gzipEntryRom.Size = br.ReadInt32BigEndian();
|
||||
}
|
||||
|
||||
using BinaryReader br = new BinaryReader(File.OpenRead(this.Filename));
|
||||
br.BaseStream.Seek(-8, SeekOrigin.End);
|
||||
gzipEntryRom.CRC = br.ReadBytesBigEndian(4);
|
||||
gzipEntryRom.Size = br.ReadInt32BigEndian();
|
||||
}
|
||||
// Otherwise, use the stream directly
|
||||
else
|
||||
|
||||
@@ -178,10 +178,8 @@ namespace SabreTools.FileTypes.Archives
|
||||
// Otherwise, use the stream directly
|
||||
else
|
||||
{
|
||||
using (Stream entryStream = entry.OpenEntryStream())
|
||||
{
|
||||
rarEntryRom = GetInfo(entryStream, size: entry.Size, hashes: this.AvailableHashes);
|
||||
}
|
||||
using Stream entryStream = entry.OpenEntryStream();
|
||||
rarEntryRom = GetInfo(entryStream, size: entry.Size, hashes: this.AvailableHashes);
|
||||
}
|
||||
|
||||
// Fill in comon details and add to the list
|
||||
|
||||
@@ -183,10 +183,8 @@ namespace SabreTools.FileTypes.Archives
|
||||
// Otherwise, use the stream directly
|
||||
else
|
||||
{
|
||||
using (Stream entryStream = entry.OpenEntryStream())
|
||||
{
|
||||
tarEntryRom = GetInfo(entryStream, size: entry.Size, hashes: this.AvailableHashes);
|
||||
}
|
||||
using Stream entryStream = entry.OpenEntryStream();
|
||||
tarEntryRom = GetInfo(entryStream, size: entry.Size, hashes: this.AvailableHashes);
|
||||
}
|
||||
|
||||
// Fill in comon details and add to the list
|
||||
|
||||
@@ -211,12 +211,11 @@ namespace SabreTools.FileTypes.Archives
|
||||
if (this.AvailableHashes == Hash.CRC)
|
||||
{
|
||||
xzEntryRom.Filename = gamename;
|
||||
using (BinaryReader br = new BinaryReader(File.OpenRead(this.Filename)))
|
||||
{
|
||||
br.BaseStream.Seek(-8, SeekOrigin.End);
|
||||
xzEntryRom.CRC = br.ReadBytesBigEndian(4);
|
||||
xzEntryRom.Size = br.ReadInt32BigEndian();
|
||||
}
|
||||
|
||||
using BinaryReader br = new BinaryReader(File.OpenRead(this.Filename));
|
||||
br.BaseStream.Seek(-8, SeekOrigin.End);
|
||||
xzEntryRom.CRC = br.ReadBytesBigEndian(4);
|
||||
xzEntryRom.Size = br.ReadInt32BigEndian();
|
||||
}
|
||||
// Otherwise, use the stream directly
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user