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
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 메소드들

메소드 설명
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