コード例 #1
0
        public LineMappingStreamReader(Stream stream) : base(stream)
        {
            // (1, 1) is the 0th byte, so the line number before the read is 1 and there is one character (the newline before the first line) before the first read.
            _firstLineNumber            = 1;
            _firstLineCharsBeforeBuffer = 1;

            _overflowCorrector = new OverflowCorrector();
        }
コード例 #2
0
        public LineMappingStreamReader(Stream stream) : base(FindBomWidth(stream, out int bomWidth))
        {
            // Record the width of any BOM, so that byte offsets we return are correct (base StreamReader will read and hide BOM)
            _bytesReadPreviously = bomWidth;

            // (1, 1) is the 0th byte, so the line number before the read is 1 and there is one character (the newline before the first line) before the first read.
            _firstLineNumber            = 1;
            _firstLineCharsBeforeBuffer = 1;

            _overflowCorrector = new OverflowCorrector();
        }