Use IO extensions where appropriate

This commit is contained in:
Matt Nadareski
2025-09-20 17:40:03 -04:00
parent 34a3050e27
commit 821a853975
4 changed files with 8 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
namespace BinaryObjectScanner.FileType
@@ -14,9 +15,7 @@ namespace BinaryObjectScanner.FileType
{
try
{
byte[] magic = new byte[16];
int read = stream.Read(magic, 0, 16);
byte[] magic = stream.ReadBytes(16);
if (magic.StartsWith(new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 }))
return "Link Data Security encrypted file";
}

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
namespace BinaryObjectScanner.FileType
@@ -16,8 +17,7 @@ namespace BinaryObjectScanner.FileType
{
try
{
byte[] magic = new byte[16];
int read = stream.Read(magic, 0, 16);
byte[] magic = stream.ReadBytes(16);
// RASGI2.0
// Found in the ".rgs" files in IA item "Nova_RealArcadeCD_USA".

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
namespace BinaryObjectScanner.FileType
@@ -16,8 +17,7 @@ namespace BinaryObjectScanner.FileType
{
try
{
byte[] magic = new byte[16];
int read = stream.Read(magic, 0, 16);
byte[] magic = stream.ReadBytes(16);
// XZip2.0
// Found in the ".mez" files in IA item "Nova_RealArcadeCD_USA".

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using SabreTools.IO.Extensions;
using SabreTools.Matching;
namespace BinaryObjectScanner.FileType
@@ -16,9 +17,7 @@ namespace BinaryObjectScanner.FileType
{
try
{
byte[] magic = new byte[16];
int read = stream.Read(magic, 0, 16);
byte[] magic = stream.ReadBytes(16);
if (magic.StartsWith(new byte?[] { 0x53, 0x46, 0x46, 0x53 }))
return "StarForce Filesystem Container";
}