Class BufferedTextReader
Abstract class representing a text reader that provides buffering on top of another text reader.
Inheritance
System.Object
System.MarshalByRefObject
System.IO.TextReader
BufferedTextReader
Implements
System.IDisposable
Inherited Members
System.IO.TextReader.Null
System.IO.TextReader.Dispose()
System.IO.TextReader.ReadAsync(System.Char[], System.Int32, System.Int32)
System.IO.TextReader.ReadBlockAsync(System.Char[], System.Int32, System.Int32)
System.IO.TextReader.ReadLine()
System.IO.TextReader.ReadLineAsync()
System.IO.TextReader.ReadToEnd()
System.IO.TextReader.ReadToEndAsync()
System.IO.TextReader.Synchronized(System.IO.TextReader)
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF.Parsing
Assembly: dotNetRDF.dll
Syntax
public abstract class BufferedTextReader : ParsingTextReader, IDisposable
Constructors
| Improve this Doc View SourceBufferedTextReader(TextReader, Int32)
Creates a buffered reader.
Declaration
protected BufferedTextReader(TextReader reader, int bufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.TextReader | reader | |
| System.Int32 | bufferSize |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | raised if bufferSize is less than 1. |
| System.ArgumentNullException | raised if reader is null. |
Fields
| Improve this Doc View Source_buffer
Buffer array.
Declaration
protected char[] _buffer
Field Value
| Type | Description |
|---|---|
| System.Char[] |
_bufferAmount
Current buffer size (may be less than length of buffer array).
Declaration
protected int _bufferAmount
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_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 |
|---|---|
| System.Int32 |
_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 |
|---|---|
| System.Int32 |
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
System.IO.TextReader.Close()
|
Improve this Doc
View Source
Dispose(Boolean)
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
System.IO.TextReader.Dispose(System.Boolean)
|
Improve this Doc
View Source
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 |
|---|---|
| System.Int32 | Character peeked or -1 if at end of input. |
Overrides
System.IO.TextReader.Peek()
|
Improve this Doc
View Source
Read()
Reads a single character from the underlying Text Reader.
Declaration
public override int Read()
Returns
| Type | Description |
|---|---|
| System.Int32 | Character read or -1 if at end of input. |
Overrides
System.IO.TextReader.Read()
|
Improve this Doc
View Source
Read(Char[], Int32, Int32)
Reads a sequence of characters from the buffer.
Declaration
public override int Read(char[] buffer, int index, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char[] | buffer | Buffer. |
| System.Int32 | index | Index at which to start writing to the Buffer. |
| System.Int32 | count | Number of characters to read. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of characters read. |
Overrides
System.IO.TextReader.Read(System.Char[], System.Int32, System.Int32)
|
Improve this Doc
View Source
ReadBlock(Char[], Int32, Int32)
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 |
|---|---|---|
| System.Char[] | buffer | Buffer. |
| System.Int32 | index | Index at which to start writing to the Buffer. |
| System.Int32 | count | Number of characters to read. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of characters read. |
Overrides
System.IO.TextReader.ReadBlock(System.Char[], System.Int32, System.Int32)
Implements
System.IDisposable