C# Класс Lucene.Net.Analysis.Util.BufferedCharFilter

LUCENENET specific class to mimic Java's BufferedReader (that is, a reader that is seekable) so it supports Mark() and Reset() (which are part of the Java Reader class), but also provide the Correct() method of BaseCharFilter. At some point we might be able to make some readers accept streams (that are seekable) so this functionality can be .NET-ified.
Наследование: Lucene.Net.Analysis.CharFilters.BaseCharFilter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BufferedCharFilter ( TextReader @in ) : Lucene.Net.Analysis.CharFilters

Creates a buffering character-input stream that uses a default-sized input buffer.

BufferedCharFilter ( TextReader @in, int sz ) : Lucene.Net.Analysis.CharFilters

Creates a buffering character-input stream that uses an input buffer of the specified size.

Close ( ) : void
InitializeLifetimeService ( ) : object
Mark ( int readAheadLimit ) : void

Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to this point.

Peek ( ) : int
Read ( ) : int

Reads a single character.

Read ( char buffer, int index, int count ) : int

Reads characters into a portion of an array. This method implements the general contract of the corresponding read method of the Reader class. As an additional convenience, it attempts to read as many characters as possible by repeatedly invoking the read method of the underlying stream.This iterated read continues until one of the following conditions becomes true: The specified number of characters have been read, The read method of the underlying stream returns -1, indicating end-of-file, or The ready method of the underlying stream returns false, indicating that further input requests would block. If the first read on the underlying stream returns -1 to indicate end-of-file then this method returns -1. Otherwise this method returns the number of characters actually read. Subclasses of this class are encouraged, but not required, to attempt to read as many characters as possible in the same fashion. Ordinarily this method takes characters from this stream's character buffer, filling it from the underlying stream as necessary. If, however, the buffer is empty, the mark is not valid, and the requested length is at least as large as the buffer, then this method will read characters directly from the underlying stream into the given array. Thus redundant BufferedReaders will not copy data unnecessarily.

ReadAsync ( char buffer, int index, int count ) : Task
ReadBlock ( char buffer, int index, int count ) : int
ReadBlockAsync ( char buffer, int index, int count ) : Task
ReadLine ( ) : string

Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.

ReadLineAsync ( ) : Task
ReadToEnd ( ) : string
ReadToEndAsync ( ) : Task
Ready ( ) : bool

Tells whether this stream is ready to be read. A buffered character stream is ready if the buffer is not empty, or if the underlying character stream is ready.

Reset ( ) : void

Resets the stream to the most recent mark.

Skip ( int n ) : long

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Приватные методы

Метод Описание
EnsureOpen ( ) : void

Checks to make sure that the stream has not been closed

Fill ( ) : void

Fills the input buffer, taking the mark into account if it is valid.

Описание методов

BufferedCharFilter() публичный Метод

Creates a buffering character-input stream that uses a default-sized input buffer.
public BufferedCharFilter ( TextReader @in ) : Lucene.Net.Analysis.CharFilters
@in TextReader
Результат Lucene.Net.Analysis.CharFilters

BufferedCharFilter() публичный Метод

Creates a buffering character-input stream that uses an input buffer of the specified size.
public BufferedCharFilter ( TextReader @in, int sz ) : Lucene.Net.Analysis.CharFilters
@in TextReader
sz int Input-buffer size
Результат Lucene.Net.Analysis.CharFilters

Close() публичный Метод

public Close ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

InitializeLifetimeService() публичный Метод

public InitializeLifetimeService ( ) : object
Результат object

Mark() публичный Метод

Marks the present position in the stream. Subsequent calls to reset() will attempt to reposition the stream to this point.
public Mark ( int readAheadLimit ) : void
readAheadLimit int Limit on the number of characters that may be read while still preserving the mark. An attempt /// to reset the stream after reading characters up to this limit or beyond may fail. A limit value larger than the size of the /// input buffer will cause a new buffer to be allocated whose size is no smaller than limit. Therefore large values should be /// used with care.
Результат void

Peek() публичный Метод

public Peek ( ) : int
Результат int

Read() публичный Метод

Reads a single character.
If an I/O error occurs
public Read ( ) : int
Результат int

Read() публичный Метод

Reads characters into a portion of an array. This method implements the general contract of the corresponding read method of the Reader class. As an additional convenience, it attempts to read as many characters as possible by repeatedly invoking the read method of the underlying stream.This iterated read continues until one of the following conditions becomes true: The specified number of characters have been read, The read method of the underlying stream returns -1, indicating end-of-file, or The ready method of the underlying stream returns false, indicating that further input requests would block. If the first read on the underlying stream returns -1 to indicate end-of-file then this method returns -1. Otherwise this method returns the number of characters actually read. Subclasses of this class are encouraged, but not required, to attempt to read as many characters as possible in the same fashion. Ordinarily this method takes characters from this stream's character buffer, filling it from the underlying stream as necessary. If, however, the buffer is empty, the mark is not valid, and the requested length is at least as large as the buffer, then this method will read characters directly from the underlying stream into the given array. Thus redundant BufferedReaders will not copy data unnecessarily.
public Read ( char buffer, int index, int count ) : int
buffer char Destination buffer
index int Offset at which to start storing characters
count int Maximum number of characters to read
Результат int

ReadAsync() публичный Метод

public ReadAsync ( char buffer, int index, int count ) : Task
buffer char
index int
count int
Результат Task

ReadBlock() публичный Метод

public ReadBlock ( char buffer, int index, int count ) : int
buffer char
index int
count int
Результат int

ReadBlockAsync() публичный Метод

public ReadBlockAsync ( char buffer, int index, int count ) : Task
buffer char
index int
count int
Результат Task

ReadLine() публичный Метод

Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
If an I/O error occurs
public ReadLine ( ) : string
Результат string

ReadLineAsync() публичный Метод

public ReadLineAsync ( ) : Task
Результат Task

ReadToEnd() публичный Метод

public ReadToEnd ( ) : string
Результат string

ReadToEndAsync() публичный Метод

public ReadToEndAsync ( ) : Task
Результат Task

Ready() публичный Метод

Tells whether this stream is ready to be read. A buffered character stream is ready if the buffer is not empty, or if the underlying character stream is ready.
public Ready ( ) : bool
Результат bool

Reset() публичный Метод

Resets the stream to the most recent mark.
If the stream has never been marked, or if the mark has been invalidated
public Reset ( ) : void
Результат void

Skip() публичный Метод

public Skip ( int n ) : long
n int
Результат long