Show / Hide Table of Contents

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
ParsingTextReader
BufferedTextReader
BlockingTextReader
NonBlockingTextReader
Implements
System.IDisposable
Inherited Members
ParsingTextReader.Create(TextReader, int)
ParsingTextReader.Create(TextReader)
ParsingTextReader.Create(Stream, int)
ParsingTextReader.Create(Stream)
ParsingTextReader.CreateBlocking(TextReader)
ParsingTextReader.CreateBlocking(TextReader, int)
ParsingTextReader.CreateNonBlocking(TextReader)
ParsingTextReader.CreateNonBlocking(TextReader, int)
System.IO.TextReader.Null
System.IO.TextReader.Dispose()
System.IO.TextReader.ReadAsync(char[], int, int)
System.IO.TextReader.ReadBlockAsync(char[], int, int)
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(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public abstract class BufferedTextReader : ParsingTextReader, IDisposable

Constructors

| Improve this Doc View Source

BufferedTextReader(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 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
char[]
| Improve this Doc View Source

_bufferAmount

Current buffer size (may be less than length of buffer array).

Declaration
protected int _bufferAmount
Field Value
Type Description
int
| Improve this Doc View Source

_finished

Whether underlying reader has been exhausted.

Declaration
protected bool _finished
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

_pos

Current buffer position.

Declaration
protected int _pos
Field Value
Type Description
int
| Improve this Doc View Source

_reader

Underlying reader.

Declaration
protected readonly TextReader _reader
Field Value
Type Description
System.IO.TextReader
| Improve this Doc View Source

DefaultBufferSize

Default Buffer Size.

Declaration
public const int DefaultBufferSize = 1024
Field Value
Type Description
int

Properties

| Improve this Doc View Source

EndOfStream

Gets whether the end of the input has been reached.

Declaration
public override bool EndOfStream { get; }
Property Value
Type Description
System.Boolean
Overrides
ParsingTextReader.EndOfStream

Methods

| Improve this Doc View Source

Close()

Closes the reader and the underlying reader.

Declaration
public override void Close()
Overrides
System.IO.TextReader.Close()
| Improve this Doc View Source

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
System.IO.TextReader.Dispose(bool)
| Improve this Doc View Source

FillBuffer()

Requests that the buffer be filled.

Declaration
protected abstract void FillBuffer()
| Improve this Doc View Source

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
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
int

Character read or -1 if at end of input.

Overrides
System.IO.TextReader.Read()
| Improve this Doc View Source

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
System.IO.TextReader.Read(char[], int, int)
| Improve this Doc View Source

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.

Overrides
System.IO.TextReader.ReadBlock(char[], int, int)

Implements

System.IDisposable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • BufferedTextReader(TextReader, int)
  • Fields
    • _buffer
    • _bufferAmount
    • _finished
    • _pos
    • _reader
    • DefaultBufferSize
  • Properties
    • EndOfStream
  • Methods
    • Close()
    • Dispose(bool)
    • FillBuffer()
    • Peek()
    • Read()
    • Read(char[], int, int)
    • ReadBlock(char[], int, int)
  • Implements
  • Extension Methods
Back to top Generated by DocFX