Ejemplo n.º 1
0
            internal DataBlock(DataBlockBuilder builder)
            {
                _appendDataPackets     = builder._appendDataPackets;
                _dataFormat            = builder.DataFormat;
                _detectors             = builder.Detectors;
                _inputFile             = builder.InputFile;
                _startOffset           = builder.StartOffset;
                _endOffset             = builder.EndOffset;
                _isFullFile            = builder.IsFullFile;
                _referenceHeaderOffset = builder.ReferenceHeaderOffset;
                _referenceHeader       = builder.ReferenceHeader;
                _codecStreams          = builder.BuildCodecStreams(this);

                IsFragmented = builder.IsFragmented;

                // Check for previous fragment and connect if one exists
                IFragment previousFragment = builder.PreviousFragment;

                if ((previousFragment != null) && previousFragment.IsFragmented)
                {
                    if (previousFragment.FragmentContainer == null)
                    {
                        previousFragment.FragmentContainer = new FragmentContainer();
                        previousFragment.FragmentContainer.Add(previousFragment);
                    }

                    FragmentContainer = previousFragment.FragmentContainer;
                    FragmentContainer.Add(this);

                    FragmentIndex = previousFragment.FragmentIndex + 1;
                }
            }
            internal CodecStream(CodecStreamBuilder builder)
            {
                _dataFormat            = builder.DataFormat;
                _detector              = builder.Detector;
                _dataPacket            = builder.Data;
                _streamNumber          = builder.StreamNumber;
                _name                  = RemoveIllegalCharatersForXml(builder.Name);
                _dataBlock             = builder.DataBlock;
                _absoluteStartOffset   = builder.AbsoluteStartOffset;
                _referenceHeaderOffset = builder.ReferenceHeaderOffset;
                _referenceHeader       = builder.ReferenceHeader;

                IsFragmented = builder.IsFragmented;

                // Check for previous fragment and connect if one exists
                IFragment previousFragment = builder.PreviousFragment;

                if ((previousFragment != null) && previousFragment.IsFragmented)
                {
                    FragmentContainer = previousFragment.FragmentContainer;
                    if (FragmentContainer == null)
                    {
                        FragmentContainer = new FragmentContainer();
                        FragmentContainer.Add(previousFragment);
                        previousFragment.FragmentContainer = FragmentContainer;
                    }

                    FragmentContainer.Add(this);

                    FragmentIndex = previousFragment.FragmentIndex + 1;
                }
            }