Alexandria.Platforms.NintendoDS.Extensions.DecompressData C# (CSharp) Method

DecompressData() public static method

Read a header and decompress data.
public static DecompressData ( this reader, long inputEnd ) : byte[]
reader this
inputEnd long
return byte[]
        public static byte[] DecompressData(this BinaryReader reader, long inputEnd)
        {
            int header = reader.ReadInt32();
            var headerCompression = (header >> 4) & 15;
            var outputSize = (header >> 8);

            if (headerCompression != 1)
                throw new Exception("Unknown compression found in LZ77-compressed block.");
            return reader.DecompressLZ77(inputEnd, outputSize);
        }