Patcher.Data.Archives.Fallout4ArchiveReader.DoGetFileStream C# (CSharp) Method

DoGetFileStream() protected method

protected DoGetFileStream ( string path ) : Stream
path string
return Stream
        protected override Stream DoGetFileStream(string path)
        {
            var file = FindFileInfo(path);
            if (file == null)
            {
                throw new InvalidOperationException("File not found in archive: " + path);
            }

            Stream stream = new FileStream(ArchivePath, FileMode.Open, FileAccess.Read);
            stream.Position = file.DataOffset;

            if (file.DataCompressedSize > 0)
            {
                return new CustomDeflateStream(stream, file.DataUncompressedSize);
            }
            else
            {
                return new ArchiveSubstream(stream, file.DataUncompressedSize);
            }
        }