Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public SectionedCharBuffer read(SectionedCharBuffer buffer, int from) throws java.io.IOException
        public override SectionedCharBuffer Read(SectionedCharBuffer buffer, int from)
        {
            while (true)
            {
                _current.read(buffer, from);
                if (buffer.HasAvailable())
                {
                    // OK we read something from the current reader
                    CheckNewLineRequirement(buffer.Array(), buffer.Front() - 1);
                    return(buffer);
                }

                // Even if there's no line-ending at the end of this source we should introduce one
                // otherwise the last line of this source and the first line of the next source will
                // look like one long line.
                if (_requiresNewLine)
                {
                    buffer.Append('\n');
                    _requiresNewLine = false;
                    return(buffer);
                }

                if (!GoToNextSource())
                {
                    break;
                }
                from = buffer.Pivot();
            }
            return(buffer);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public SectionedCharBuffer read(SectionedCharBuffer buffer, int from) throws java.io.IOException
            public override SectionedCharBuffer Read(SectionedCharBuffer buffer, int from)
            {
                try
                {
                    return(RegisterBytesRead(Actual.read(buffer, from)));
                }
                finally
                {
                    ReadsCompleted++;
                }
            }
Beispiel #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected boolean readAhead() throws java.io.IOException
        protected internal override bool ReadAhead()
        {
            _theOtherBuffer = _actual.read(_theOtherBuffer, _theOtherBuffer.front());
            string sourceDescriptionAfterRead = _actual.sourceDescription();

            if (!_sourceDescription.Equals(sourceDescriptionAfterRead))
            {
                _newSourceDescription = sourceDescriptionAfterRead;
            }

            return(_theOtherBuffer.hasAvailable());
        }
Beispiel #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public Source_Chunk nextChunk(int seekStartPos) throws java.io.IOException
        public override Source_Chunk NextChunk(int seekStartPos)
        {
            _charBuffer = _reader.read(_charBuffer, seekStartPos == -1 ? _charBuffer.pivot() : seekStartPos);

            return(new Source_ChunkAnonymousInnerClass(this));
        }