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
| Improve this Doc View SourceBufferedTextReader(TextReader, int)
Creates a buffered reader.
Declaration
protected BufferedTextReader(TextReader reader, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | reader | |
int | bufferSize |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | raised if |
System.ArgumentNullException | raised if |
Fields
| Improve this Doc View Source_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 |
---|---|
System.Boolean |
_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 |
---|---|
System.IO.TextReader |
DefaultBufferSize
Default Buffer Size.
Declaration
public const int DefaultBufferSize = 1024
Field Value
Type | Description |
---|---|
int |
Properties
| Improve this Doc View SourceEndOfStream
Gets whether the end of the input has been reached.
Declaration
public override bool EndOfStream { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Methods
| Improve this Doc View SourceClose()
Closes the reader and the underlying reader.
Declaration
public override void Close()
Overrides
Dispose(bool)
Disposes of the reader and the underlying reader.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Whether this was called from the Dispose() method. |
Overrides
FillBuffer()
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
Read()
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
Read(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
ReadBlock(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. |