Show / Hide Table of Contents

    Class 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.

    Inheritance
    System.Object
    CharFilter
    BaseCharFilter
    BufferedCharFilter
    Inherited Members
    BaseCharFilter.Correct(Int32)
    BaseCharFilter.LastCumulativeDiff
    BaseCharFilter.AddOffCorrectMap(Int32, Int32)
    CharFilter.m_input
    CharFilter.CorrectOffset(Int32)
    Namespace: Lucene.Net.Analysis.Util
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public class BufferedCharFilter : BaseCharFilter

    Constructors

    | Improve this Doc View Source

    BufferedCharFilter(TextReader)

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

    Declaration
    public BufferedCharFilter(TextReader in)
    Parameters
    Type Name Description
    TextReader in

    A TextReader

    | Improve this Doc View Source

    BufferedCharFilter(TextReader, Int32)

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

    Declaration
    public BufferedCharFilter(TextReader in, int size)
    Parameters
    Type Name Description
    TextReader in

    A TextReader

    System.Int32 size

    Input-buffer size

    Fields

    | Improve this Doc View Source

    DEFAULT_CHAR_BUFFER_SIZE

    Declaration
    public const int DEFAULT_CHAR_BUFFER_SIZE = null
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_lock

    The object used to synchronize access to the reader.

    Declaration
    protected object m_lock
    Field Value
    Type Description
    System.Object

    Properties

    | Improve this Doc View Source

    IsMarkSupported

    Indicates whether this reader supports the Mark(Int32) and Reset() methods. This implementation returns true.

    Declaration
    public override bool IsMarkSupported { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    CharFilter.IsMarkSupported
    See Also
    Mark(Int32)
    Reset()
    | Improve this Doc View Source

    IsReady

    Indicates whether this reader is ready to be read without blocking.

    Declaration
    public override bool IsReady { get; }
    Property Value
    Type Description
    System.Boolean

    true if this reader will not block when Read() is called, false if unknown or blocking will occur.

    Overrides
    CharFilter.IsReady

    Methods

    | Improve this Doc View Source

    Close()

    Declaration
    public override void Close()
    | Improve this Doc View Source

    Dispose(Boolean)

    Disposes this reader. This implementation closes the buffered source reader and releases the buffer. Nothing is done if this reader has already been disposed.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    InitializeLifetimeService()

    Declaration
    public override object InitializeLifetimeService()
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    Mark(Int32)

    Sets a mark position in this reader. The parameter markLimit indicates how many characters can be read before the mark is invalidated. Calling Reset() will reposition the reader back to the marked position if Lucene.Net.Analysis.Util.BufferedCharFilter.markLimit has not been surpassed.

    Declaration
    public override void Mark(int markLimit)
    Parameters
    Type Name Description
    System.Int32 markLimit

    the number of characters that can be read before the mark is invalidated.

    | Improve this Doc View Source

    Peek()

    Declaration
    public override int Peek()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Read()

    Reads a single character from this reader and returns it with the two higher-order bytes set to 0. If possible, BufferedCharFilter returns a character from the buffer. If there are no characters available in the buffer, it fills the buffer and then returns a character. It returns -1 if there are no more characters in the source reader.

    Declaration
    public override int Read()
    Returns
    Type Description
    System.Int32

    The character read or -1 if the end of the source reader has been reached.

    Overrides
    CharFilter.Read()
    | Improve this Doc View Source

    Read(Char[], Int32, Int32)

    Reads at most length characters from this reader and stores them at offset in the character array buffer. Returns the number of characters actually read or -1 if the end of the source reader has been reached. If all the buffered characters have been used, a mark has not been set and the requested number of characters is larger than this readers buffer size, BufferedReader bypasses the buffer and simply places the results directly into buffer.

    Declaration
    public override int Read(char[] buffer, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] buffer

    the character array to store the characters read.

    System.Int32 offset

    the initial position in buffer to store the bytes read from this reader.

    System.Int32 length

    the maximum number of characters to read, must be non-negative.

    Returns
    Type Description
    System.Int32

    number of characters read or -1 if the end of the source reader has been reached.

    | Improve this Doc View Source

    ReadAsync(Char[], Int32, Int32)

    Declaration
    public override Task<int> ReadAsync(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    System.Char[] buffer
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    Task<System.Int32>
    | Improve this Doc View Source

    ReadBlock(Char[], Int32, Int32)

    Declaration
    public override int ReadBlock(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    System.Char[] buffer
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    ReadBlockAsync(Char[], Int32, Int32)

    Declaration
    public override Task<int> ReadBlockAsync(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    System.Char[] buffer
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    Task<System.Int32>
    | Improve this Doc View Source

    ReadLine()

    Returns the next line of text available from this reader. A line is represented by zero or more characters followed by '\n', '\r', "\r\n" or the end of the reader. The string does not include the newline sequence.

    Declaration
    public override string ReadLine()
    Returns
    Type Description
    System.String

    The contents of the line or null if no characters were read before the end of the reader has been reached.

    | Improve this Doc View Source

    ReadLineAsync()

    Declaration
    public override Task<string> ReadLineAsync()
    Returns
    Type Description
    Task<System.String>
    | Improve this Doc View Source

    ReadToEnd()

    Declaration
    public override string ReadToEnd()
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ReadToEndAsync()

    Declaration
    public override Task<string> ReadToEndAsync()
    Returns
    Type Description
    Task<System.String>
    | Improve this Doc View Source

    Reset()

    Resets this reader's position to the last Mark(Int32) location. Invocations of Read() and Skip(Int32) will occur from this new location.

    Declaration
    public override void Reset()
    Overrides
    CharFilter.Reset()
    See Also
    Mark(Int32)
    IsMarkSupported
    | Improve this Doc View Source

    Skip(Int32)

    Skips amount characters in this reader. Subsequent Read()s will not return these characters unless Reset() is used. Skipping characters may invalidate a mark if Lucene.Net.Analysis.Util.BufferedCharFilter.markLimit is surpassed.

    Declaration
    public override long Skip(int amount)
    Parameters
    Type Name Description
    System.Int32 amount

    the maximum number of characters to skip.

    Returns
    Type Description
    System.Int64

    the number of characters actually skipped.

    See Also
    Mark(Int32)
    IsMarkSupported
    Reset()
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)