Class BufferedTextReader
Abstract class representing a text reader that provides buffering on top of another text reader.
Inheritance
Implements
Inherited Members
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public abstract class BufferedTextReader : ParsingTextReader, IDisposable
Constructors
| Edit this page View SourceBufferedTextReader(TextReader, int)
Creates a buffered reader.
Declaration
protected BufferedTextReader(TextReader reader, int bufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| TextReader | reader | |
| int | bufferSize |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | raised if |
| ArgumentNullException | raised if |
Fields
| Edit this page View SourceDefaultBufferSize
Default Buffer Size.
Declaration
public const int DefaultBufferSize = 1024
Field Value
| Type | Description |
|---|---|
| int |
_buffer
Buffer array.
Declaration
protected char[] _buffer
Field Value
| Type | Description |
|---|---|
| char[] |
_bufferAmount
Current buffer size (may be less than length of buffer array).
Declaration
protected int _bufferAmount
Field Value
| Type | Description |
|---|---|
| int |
_finished
Whether underlying reader has been exhausted.
Declaration
protected bool _finished
Field Value
| Type | Description |
|---|---|
| bool |
_pos
Current buffer position.
Declaration
protected int _pos
Field Value
| Type | Description |
|---|---|
| int |
_reader
Underlying reader.
Declaration
protected readonly TextReader _reader
Field Value
| Type | Description |
|---|---|
| TextReader |
Properties
| Edit this page View SourceEndOfStream
Gets whether the end of the input has been reached.
Declaration
public override bool EndOfStream { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Methods
| Edit this page View SourceClose()
Closes the reader and the underlying reader.
Declaration
public override void Close()
Overrides
| Edit this page View SourceDispose(bool)
Disposes of the reader and the underlying reader.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Whether this was called from the Dispose() method. |
Overrides
| Edit this page View SourceFillBuffer()
Requests that the buffer be filled.
Declaration
protected abstract void FillBuffer()
Peek()
Peeks at the next character from the underlying Text Reader.
Declaration
public override int Peek()
Returns
| Type | Description |
|---|---|
| int | Character peeked or -1 if at end of input. |
Overrides
| Edit this page View SourceRead()
Reads a single character from the underlying Text Reader.
Declaration
public override int Read()
Returns
| Type | Description |
|---|---|
| int | Character read or -1 if at end of input. |
Overrides
| Edit this page View SourceRead(char[], int, int)
Reads a sequence of characters from the buffer.
Declaration
public override int Read(char[] buffer, int index, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| char[] | buffer | Buffer. |
| int | index | Index at which to start writing to the Buffer. |
| int | count | Number of characters to read. |
Returns
| Type | Description |
|---|---|
| int | Number of characters read. |
Overrides
| Edit this page View SourceReadBlock(char[], int, int)
Reads a sequence of characters from the buffer in a blocking way.
Declaration
public override int ReadBlock(char[] buffer, int index, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| char[] | buffer | Buffer. |
| int | index | Index at which to start writing to the Buffer. |
| int | count | Number of characters to read. |
Returns
| Type | Description |
|---|---|
| int | Number of characters read. |