C# Class 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.
Inheritance: Lucene.Net.Analysis.CharFilters.BaseCharFilter
Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode Description
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.

Method Details

BufferedCharFilter() public méthode

Creates a buffering character-input stream that uses a default-sized input buffer.
public BufferedCharFilter ( TextReader @in ) : Lucene.Net.Analysis.CharFilters
@in TextReader
Résultat Lucene.Net.Analysis.CharFilters

BufferedCharFilter() public méthode

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
Résultat Lucene.Net.Analysis.CharFilters

Close() public méthode

public Close ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

InitializeLifetimeService() public méthode

public InitializeLifetimeService ( ) : object
Résultat object

Mark() public méthode

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.
Résultat void

Peek() public méthode

public Peek ( ) : int
Résultat int

Read() public méthode

Reads a single character.
If an I/O error occurs
public Read ( ) : int
Résultat int

Read() public méthode

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
Résultat int

ReadAsync() public méthode

public ReadAsync ( char buffer, int index, int count ) : Task
buffer char
index int
count int
Résultat Task

ReadBlock() public méthode

public ReadBlock ( char buffer, int index, int count ) : int
buffer char
index int
count int
Résultat int

ReadBlockAsync() public méthode

public ReadBlockAsync ( char buffer, int index, int count ) : Task
buffer char
index int
count int
Résultat Task

ReadLine() public méthode

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
Résultat string

ReadLineAsync() public méthode

public ReadLineAsync ( ) : Task
Résultat Task

ReadToEnd() public méthode

public ReadToEnd ( ) : string
Résultat string

ReadToEndAsync() public méthode

public ReadToEndAsync ( ) : Task
Résultat Task

Ready() public méthode

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
Résultat bool

Reset() public méthode

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
Résultat void

Skip() public méthode

public Skip ( int n ) : long
n int
Résultat long