Class BufferedIndexInput
Base implementation class for buffered IndexInput.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public abstract class BufferedIndexInput : IndexInput, IDisposable
Constructors
BufferedIndexInput(string)
Base implementation class for buffered IndexInput.
Declaration
protected BufferedIndexInput(string resourceDesc)
Parameters
Type | Name | Description |
---|---|---|
string | resourceDesc |
BufferedIndexInput(string, IOContext)
Base implementation class for buffered IndexInput.
Declaration
protected BufferedIndexInput(string resourceDesc, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
string | resourceDesc | |
IOContext | context |
BufferedIndexInput(string, int)
Inits BufferedIndexInput with a specific bufferSize
Declaration
protected BufferedIndexInput(string resourceDesc, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
string | resourceDesc | |
int | bufferSize |
Fields
BUFFER_SIZE
Default buffer size set to BUFFER_SIZE.
Declaration
public const int BUFFER_SIZE = 1024
Field Value
Type | Description |
---|---|
int |
MERGE_BUFFER_SIZE
A buffer size for merges set to MERGE_BUFFER_SIZE.
Declaration
public const int MERGE_BUFFER_SIZE = 4096
Field Value
Type | Description |
---|---|
int |
m_buffer
Base implementation class for buffered IndexInput.
Declaration
protected byte[] m_buffer
Field Value
Type | Description |
---|---|
byte[] |
Properties
BufferSize
Returns buffer size.
Declaration
public int BufferSize { get; }
Property Value
Type | Description |
---|---|
int |
See Also
Position
Returns the current position in this file, where the next read will occur.
This was getFilePointer() in Lucene.Declaration
public override sealed long Position { get; }
Property Value
Type | Description |
---|---|
long |
Overrides
See Also
Methods
Clone()
Returns a clone of this stream.
Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from. Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from. Warning: Lucene never closes cloned IndexInputs, it will only do this on the original one. The original instance must take care that cloned instances throw ObjectDisposedException when the original one is closed.Declaration
public override object Clone()
Returns
Type | Description |
---|---|
object |
Overrides
FlushBuffer(IndexOutput, long)
Flushes the in-memory buffer to the given output, copying at most
numBytes
.
Declaration
protected int FlushBuffer(IndexOutput @out, long numBytes)
Parameters
Type | Name | Description |
---|---|---|
IndexOutput | out | |
long | numBytes |
Returns
Type | Description |
---|---|
int | the number of bytes actually flushed from the in-memory buffer. |
GetBufferSize(IOContext)
Returns default buffer sizes for the given IOContext
Declaration
public static int GetBufferSize(IOContext context)
Parameters
Type | Name | Description |
---|---|---|
IOContext | context |
Returns
Type | Description |
---|---|
int |
NewBuffer(byte[])
Base implementation class for buffered IndexInput.
Declaration
protected virtual void NewBuffer(byte[] newBuffer)
Parameters
Type | Name | Description |
---|---|---|
byte[] | newBuffer |
ReadByte()
Reads and returns a single byte.
Declaration
public override sealed byte ReadByte()
Returns
Type | Description |
---|---|
byte |
Overrides
See Also
ReadBytes(byte[], int, int)
Reads a specified number of bytes into an array at the specified offset.
Declaration
public override sealed void ReadBytes(byte[] b, int offset, int len)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | the array to read bytes into |
int | offset | the offset in the array to start storing bytes |
int | len | the number of bytes to read |
Overrides
See Also
ReadBytes(byte[], int, int, bool)
Reads a specified number of bytes into an array at the
specified offset with control over whether the read
should be buffered (callers who have their own buffer
should pass in "false" for useBuffer
). Currently only
BufferedIndexInput respects this parameter.
Declaration
public override sealed void ReadBytes(byte[] b, int offset, int len, bool useBuffer)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | the array to read bytes into |
int | offset | the offset in the array to start storing bytes |
int | len | the number of bytes to read |
bool | useBuffer | set to false if the caller will handle buffering. |
Overrides
See Also
ReadInt16()
NOTE: this was readShort() in Lucene
Declaration
public override sealed short ReadInt16()
Returns
Type | Description |
---|---|
short |
Overrides
ReadInt32()
NOTE: this was readInt() in Lucene
Declaration
public override sealed int ReadInt32()
Returns
Type | Description |
---|---|
int |
Overrides
ReadInt64()
NOTE: this was readLong() in Lucene
Declaration
public override sealed long ReadInt64()
Returns
Type | Description |
---|---|
long |
Overrides
ReadInternal(byte[], int, int)
Expert: implements buffer refill. Reads bytes from the current position in the input.
Declaration
protected abstract void ReadInternal(byte[] b, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | the array to read bytes into |
int | offset | the offset in the array to start storing bytes |
int | length | the number of bytes to read |
ReadVInt32()
NOTE: this was readVInt() in Lucene
Declaration
public override sealed int ReadVInt32()
Returns
Type | Description |
---|---|
int |
Overrides
ReadVInt64()
NOTE: this was readVLong() in Lucene
Declaration
public override sealed long ReadVInt64()
Returns
Type | Description |
---|---|
long |
Overrides
Seek(long)
Sets current position in this file, where the next read will occur.
Declaration
public override sealed void Seek(long pos)
Parameters
Type | Name | Description |
---|---|---|
long | pos |
Overrides
See Also
SeekInternal(long)
Expert: implements seek. Sets current position in this file, where the next ReadInternal(byte[], int, int) will occur.
Declaration
protected abstract void SeekInternal(long pos)
Parameters
Type | Name | Description |
---|---|---|
long | pos |
See Also
SetBufferSize(int)
Change the buffer size used by this IndexInput
Declaration
public void SetBufferSize(int newSize)
Parameters
Type | Name | Description |
---|---|---|
int | newSize |