Beispiel #1
0
        private void ParseDeltaStructure()
        {
            var reader = new FileReader(Delta.AsFile(OpenMode.Read));

            reader.Position = Header.FragmentHeaderSize;

            long offset = 0;

            while (offset < Header.NewSize)
            {
                ReadSegmentHeader(reader, out int size, out int seek);

                if (seek > 0)
                {
                    var segment = new DeltaFragmentSegment()
                    {
                        SourceOffset = offset,
                        Size         = seek,
                        IsInOriginal = true
                    };

                    Segments.Add(segment);
                    offset += seek;
                }

                if (size > 0)
                {
                    var segment = new DeltaFragmentSegment()
                    {
                        SourceOffset = reader.Position,
                        Size         = size,
                        IsInOriginal = false
                    };

                    Segments.Add(segment);
                    offset += size;
                }

                reader.Position += size;
            }
        }