示例#1
0
        protected override byte[] GetArkEntryBytes(ArkEntry entry)
        {
            string filePath = Path.Combine(_fullPath, entry.FullPath);
            var    bytes    = File.ReadAllBytes(filePath);

            // TODO: Figure out a better place to put this compression check
            if (entry.Extension.Equals("gz", StringComparison.CurrentCultureIgnoreCase))
            {
                return(Compression.InflateBlock(bytes, CompressionType.GZIP));
            }
            // TODO: Check zlib (Else if statement)

            return(bytes);
        }
示例#2
0
 public Stream GetArkEntryFileStream(ArkEntry entry) => new MemoryStream(GetArkEntryBytes(entry), false); // Read-only