diff --git a/SabreTools.FileTypes/AaruFormat.cs b/SabreTools.FileTypes/AaruFormat.cs index 079facec..719c89b1 100644 --- a/SabreTools.FileTypes/AaruFormat.cs +++ b/SabreTools.FileTypes/AaruFormat.cs @@ -98,7 +98,7 @@ namespace SabreTools.FileTypes return false; // If the bytes don't match, we don't have an AaruFormat - if (!magicBytes.StartsWith(Constants.AaruFormatSignature)) + if (!magicBytes.StartsWith(AaruFormatSignature)) return false; return true; diff --git a/SabreTools.FileTypes/BaseFile.cs b/SabreTools.FileTypes/BaseFile.cs index f4ae2578..34a37610 100644 --- a/SabreTools.FileTypes/BaseFile.cs +++ b/SabreTools.FileTypes/BaseFile.cs @@ -15,29 +15,29 @@ namespace SabreTools.FileTypes { #region Constants - private static readonly byte[] SevenZipSignature = { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c }; - private static readonly byte[] AaruFormatSignature = { 0x41, 0x41, 0x52, 0x55, 0x46, 0x52, 0x4d, 0x54 }; - private static readonly byte[] BZ2Signature = { 0x42, 0x5a, 0x68 }; - private static readonly byte[] CabinetSignature = { 0x4d, 0x53, 0x43, 0x46 }; - private static readonly byte[] CHDSignature = { 0x4d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x48, 0x44 }; - private static readonly byte[] ELFSignature = { 0x7f, 0x45, 0x4c, 0x46 }; - private static readonly byte[] FreeArcSignature = { 0x41, 0x72, 0x43, 0x01 }; - private static readonly byte[] GzSignature = { 0x1f, 0x8b, 0x08 }; - private static readonly byte[] LRZipSignature = { 0x4c, 0x52, 0x5a, 0x49 }; - private static readonly byte[] LZ4Signature = { 0x18, 0x4d, 0x22, 0x04 }; - private static readonly byte[] LZ4SkippableMinSignature = { 0x18, 0x4d, 0x22, 0x04 }; - private static readonly byte[] LZ4SkippableMaxSignature = { 0x18, 0x4d, 0x2a, 0x5f }; - private static readonly byte[] PESignature = { 0x4d, 0x5a }; - private static readonly byte[] RarSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }; - private static readonly byte[] RarFiveSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 }; - private static readonly byte[] TarSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 }; - private static readonly byte[] TarZeroSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 }; - private static readonly byte[] XZSignature = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00 }; - private static readonly byte[] ZipSignature = { 0x50, 0x4b, 0x03, 0x04 }; - private static readonly byte[] ZipSignatureEmpty = { 0x50, 0x4b, 0x05, 0x06 }; - private static readonly byte[] ZipSignatureSpanned = { 0x50, 0x4b, 0x07, 0x08 }; - private static readonly byte[] ZPAQSignature = { 0x7a, 0x50, 0x51 }; - private static readonly byte[] ZstdSignature = { 0xfd, 0x2f, 0xb5 }; + protected static readonly byte[] SevenZipSignature = { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c }; + protected static readonly byte[] AaruFormatSignature = { 0x41, 0x41, 0x52, 0x55, 0x46, 0x52, 0x4d, 0x54 }; + protected static readonly byte[] BZ2Signature = { 0x42, 0x5a, 0x68 }; + protected static readonly byte[] CabinetSignature = { 0x4d, 0x53, 0x43, 0x46 }; + protected static readonly byte[] CHDSignature = { 0x4d, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x48, 0x44 }; + protected static readonly byte[] ELFSignature = { 0x7f, 0x45, 0x4c, 0x46 }; + protected static readonly byte[] FreeArcSignature = { 0x41, 0x72, 0x43, 0x01 }; + protected static readonly byte[] GzSignature = { 0x1f, 0x8b, 0x08 }; + protected static readonly byte[] LRZipSignature = { 0x4c, 0x52, 0x5a, 0x49 }; + protected static readonly byte[] LZ4Signature = { 0x18, 0x4d, 0x22, 0x04 }; + protected static readonly byte[] LZ4SkippableMinSignature = { 0x18, 0x4d, 0x22, 0x04 }; + protected static readonly byte[] LZ4SkippableMaxSignature = { 0x18, 0x4d, 0x2a, 0x5f }; + protected static readonly byte[] PESignature = { 0x4d, 0x5a }; + protected static readonly byte[] RarSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }; + protected static readonly byte[] RarFiveSignature = { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 }; + protected static readonly byte[] TarSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 }; + protected static readonly byte[] TarZeroSignature = { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 }; + protected static readonly byte[] XZSignature = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00 }; + protected static readonly byte[] ZipSignature = { 0x50, 0x4b, 0x03, 0x04 }; + protected static readonly byte[] ZipSignatureEmpty = { 0x50, 0x4b, 0x05, 0x06 }; + protected static readonly byte[] ZipSignatureSpanned = { 0x50, 0x4b, 0x07, 0x08 }; + protected static readonly byte[] ZPAQSignature = { 0x7a, 0x50, 0x51 }; + protected static readonly byte[] ZstdSignature = { 0xfd, 0x2f, 0xb5 }; #endregion diff --git a/SabreTools.Logging/LoggerImpl.cs b/SabreTools.Logging/LoggerImpl.cs index 15132aed..99aea84f 100644 --- a/SabreTools.Logging/LoggerImpl.cs +++ b/SabreTools.Logging/LoggerImpl.cs @@ -113,7 +113,7 @@ namespace SabreTools.Logging Directory.CreateDirectory(LogDirectory); FileStream logfile = File.Create(Path.Combine(LogDirectory, Filename)); - _log = new StreamWriter(logfile, Encoding.UTF8, (int)(4 * Constants.KibiByte), true) + _log = new StreamWriter(logfile, Encoding.UTF8, 4096, true) { AutoFlush = true };