Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BufferedIndexOutput

    Base implementation class for buffered IndexOutput.

    Inheritance
    object
    DataOutput
    IndexOutput
    BufferedIndexOutput
    FSDirectory.FSIndexOutput
    Implements
    IDisposable
    Inherited Members
    IndexOutput.Dispose()
    DataOutput.WriteBytes(byte[], int)
    DataOutput.WriteInt32(int)
    DataOutput.WriteInt16(short)
    DataOutput.WriteVInt32(int)
    DataOutput.WriteInt64(long)
    DataOutput.WriteVInt64(long)
    DataOutput.WriteString(string)
    DataOutput.CopyBytes(DataInput, long)
    DataOutput.WriteStringStringMap(IDictionary<string, string>)
    DataOutput.WriteStringSet(ISet<string>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class BufferedIndexOutput : IndexOutput, IDisposable

    Constructors

    BufferedIndexOutput()

    Creates a new BufferedIndexOutput with the default buffer size (DEFAULT_BUFFER_SIZE bytes see DEFAULT_BUFFER_SIZE)

    Declaration
    protected BufferedIndexOutput()

    BufferedIndexOutput(int)

    Creates a new BufferedIndexOutput with the given buffer size.

    Declaration
    protected BufferedIndexOutput(int bufferSize)
    Parameters
    Type Name Description
    int bufferSize

    the buffer size in bytes used to buffer writes internally.

    Exceptions
    Type Condition
    ArgumentException

    if the given buffer size is less or equal to 0

    Fields

    DEFAULT_BUFFER_SIZE

    The default buffer size in bytes (DEFAULT_BUFFER_SIZE).

    Declaration
    public const int DEFAULT_BUFFER_SIZE = 16384
    Field Value
    Type Description
    int

    Properties

    BufferSize

    Returns size of the used output buffer in bytes.

    Declaration
    public int BufferSize { get; }
    Property Value
    Type Description
    int

    Checksum

    Returns the current checksum of bytes written so far

    Declaration
    public override long Checksum { get; }
    Property Value
    Type Description
    long
    Overrides
    IndexOutput.Checksum

    Length

    Gets or Sets the file length. By default, this property's setter does nothing (it's optional for a Directory to implement it). But, certain Directory implementations (for example FSDirectory) can use this to inform the underlying IO system to pre-allocate the file to the specified size. If the length is longer than the current file length, the bytes added to the file are undefined. Otherwise the file is truncated.

    Declaration
    public override abstract long Length { get; }
    Property Value
    Type Description
    long
    Overrides
    IndexOutput.Length

    Position

    Returns the current position in this file, where the next write will occur.

    This was getFilePointer() in Lucene.
    Declaration
    public override long Position { get; }
    Property Value
    Type Description
    long
    Overrides
    IndexOutput.Position
    See Also
    Seek(long)

    Methods

    Dispose(bool)

    Closes this stream to further operations.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    IndexOutput.Dispose(bool)

    Flush()

    Forces any buffered output to be written.

    Declaration
    public override void Flush()
    Overrides
    IndexOutput.Flush()

    FlushBuffer(byte[], int, int)

    Expert: implements buffer write. Writes bytes at the current position in the output.

    Declaration
    protected abstract void FlushBuffer(byte[] b, int offset, int len)
    Parameters
    Type Name Description
    byte[] b

    the bytes to write

    int offset

    the offset in the byte array

    int len

    the number of bytes to write

    Seek(long)

    Sets current position in this file, where the next write will occur.

    Declaration
    [Obsolete("(4.1) this method will be removed in Lucene 5.0")]
    public override void Seek(long pos)
    Parameters
    Type Name Description
    long pos
    Overrides
    IndexOutput.Seek(long)
    See Also
    Position

    WriteByte(byte)

    Writes a single byte.

    The most primitive data type is an eight-bit byte. Files are accessed as sequences of bytes. All other data types are defined as sequences of bytes, so file formats are byte-order independent.
    Declaration
    public override void WriteByte(byte b)
    Parameters
    Type Name Description
    byte b
    Overrides
    DataOutput.WriteByte(byte)
    See Also
    ReadByte()

    WriteBytes(byte[], int, int)

    Writes an array of bytes.

    Declaration
    public override void WriteBytes(byte[] b, int offset, int length)
    Parameters
    Type Name Description
    byte[] b

    the bytes to write

    int offset

    the offset in the byte array

    int length

    the number of bytes to write

    Overrides
    DataOutput.WriteBytes(byte[], int, int)
    See Also
    ReadBytes(byte[], int, int)

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.