public override void PrimeOutput(int outputs, int[] outputIDs, PipelineBuffer[] buffers)
        {
            PipelineBuffer mainBuffer  = null;
            PipelineBuffer errorBuffer = null;
            IDTSOutput100  mainOutput  = null;

            int errorOutID    = 0;
            int errorOutIndex = 0;

            // If there is an error output, figure out which output is the main
            // and which is the error
            if (outputs == 2)
            {
                GetErrorOutputInfo(ref errorOutID, ref errorOutIndex);

                if (outputIDs[0] == errorOutID)
                {
                    mainBuffer  = buffers[1];
                    errorBuffer = buffers[0];
                    mainOutput  = this.ComponentMetaData.OutputCollection[1];
                }
                else
                {
                    mainBuffer  = buffers[0];
                    errorBuffer = buffers[1];
                    mainOutput  = this.ComponentMetaData.OutputCollection[0];
                }
            }
            else
            {
                mainBuffer = buffers[0];
                mainOutput = this.ComponentMetaData.OutputCollection[0];
            }

            bool firstRowColumnNames = (bool)this.GetComponentPropertyValue(PropertiesManager.ColumnNamesInFirstRowPropName);
            bool treatNulls          = (bool)this.GetComponentPropertyValue(PropertiesManager.TreatEmptyStringsAsNullPropName);

            FileReader             reader        = new FileReader(this.fileName, this.GetEncoding());
            DelimitedFileParser    parser        = this.CreateParser();
            ComponentBufferService bufferService = new ComponentBufferService(mainBuffer, errorBuffer);

            BufferSink bufferSink = new BufferSink(bufferService, mainOutput, treatNulls);

            bufferSink.CurrentRowCount = parser.HeaderRowsToSkip + parser.DataRowsToSkip + (firstRowColumnNames ? 1 : 0);

            try
            {
                parser.SkipInitialRows(reader);

                RowData rowData = new RowData();
                while (!reader.IsEOF)
                {
                    parser.ParseNextRow(reader, rowData);
                    if (rowData.ColumnCount == 0)
                    {
                        // Last row with no data will be ignored.
                        break;
                    }
                    bufferSink.AddRow(rowData);
                }
            }
            catch (ParsingBufferOverflowException ex)
            {
                this.PostErrorAndThrow(MessageStrings.ParsingBufferOverflow(bufferSink.CurrentRowCount + 1, ex.ColumnIndex + 1, FieldParser.ParsingBufferMaxSize));
            }
            catch (RowColumnNumberOverflow)
            {
                this.PostErrorAndThrow(MessageStrings.MaximumColumnNumberOverflow(bufferSink.CurrentRowCount + 1, RowParser.MaxColumnNumber));
            }
            finally
            {
                reader.Close();
            }

            foreach (PipelineBuffer buffer in buffers)
            {
                buffer.SetEndOfRowset();
            }
        }
        public override void PrimeOutput(int outputs, int[] outputIDs, PipelineBuffer[] buffers)
        {
            PipelineBuffer mainBuffer = null;
            PipelineBuffer errorBuffer = null;
            IDTSOutput100 mainOutput = null;

            int errorOutID = 0;
            int errorOutIndex = 0;

            // If there is an error output, figure out which output is the main
            // and which is the error
            if (outputs == 2)
            {
                GetErrorOutputInfo(ref errorOutID, ref errorOutIndex);

                if (outputIDs[0] == errorOutID)
                {
                    mainBuffer = buffers[1];
                    errorBuffer = buffers[0];
                    mainOutput = this.ComponentMetaData.OutputCollection[1];
                }
                else
                {
                    mainBuffer = buffers[0];
                    errorBuffer = buffers[1];
                    mainOutput = this.ComponentMetaData.OutputCollection[0];
                }
            }
            else
            {
                mainBuffer = buffers[0];
                mainOutput = this.ComponentMetaData.OutputCollection[0];
            }

            bool firstRowColumnNames = (bool)this.GetComponentPropertyValue(PropertiesManager.ColumnNamesInFirstRowPropName);
            bool treatNulls = (bool)this.GetComponentPropertyValue(PropertiesManager.TreatEmptyStringsAsNullPropName);

            FileReader reader = new FileReader(this.fileName, this.GetEncoding());
            DelimitedFileParser parser = this.CreateParser();
            ComponentBufferService bufferService = new ComponentBufferService(mainBuffer, errorBuffer);

            BufferSink bufferSink = new BufferSink(bufferService, mainOutput, treatNulls);
            bufferSink.CurrentRowCount = parser.HeaderRowsToSkip + parser.DataRowsToSkip + (firstRowColumnNames ? 1 : 0);

            try
            {
                parser.SkipInitialRows(reader);

                RowData rowData = new RowData();
                while (!reader.IsEOF)
                {
                    parser.ParseNextRow(reader, rowData);
                    if (rowData.ColumnCount == 0)
                    {
                        // Last row with no data will be ignored.
                        break;
                    }
                    bufferSink.AddRow(rowData);
                }
            }
            catch (ParsingBufferOverflowException ex)
            {
                this.PostErrorAndThrow(MessageStrings.ParsingBufferOverflow(bufferSink.CurrentRowCount + 1, ex.ColumnIndex + 1, FieldParser.ParsingBufferMaxSize));
            }
            catch (RowColumnNumberOverflow)
            {
                this.PostErrorAndThrow(MessageStrings.MaximumColumnNumberOverflow(bufferSink.CurrentRowCount + 1, RowParser.MaxColumnNumber));
            }
            finally
            {
                reader.Close();
            }

            foreach (PipelineBuffer buffer in buffers)
            {
                buffer.SetEndOfRowset();
            }
        }