CLucene - a full-featured, c++ search engine
API Documentation


lucene::store::BufferedIndexInput Class Reference

Abstract base class for input from a file in a Directory. More...

#include <IndexInput.h>

Inheritance diagram for lucene::store::BufferedIndexInput:
lucene::store::IndexInput lucene::debug::LuceneBase lucene::store::RAMIndexInput

List of all members.

Public Member Functions

virtual ~BufferedIndexInput ()
virtual IndexInputclone () const =0
void close ()
 Closes the stream to futher operations.
uint8_t readByte ()
 Reads and returns a single byte.
void readBytes (uint8_t *b, const int32_t len)
 Reads a specified number of bytes into an array at the specified offset.
int64_t getFilePointer () const
 Returns the current position in this file, where the next read will occur.
void seek (const int64_t pos)
 Sets current position in this file, where the next read will occur.

Protected Member Functions

 BufferedIndexInput (const BufferedIndexInput &clone)
 Returns a clone of this stream.
 BufferedIndexInput (int32_t bufferSize=lucene::store::BufferedIndexOutput::BUFFER_SIZE)
virtual void readInternal (uint8_t *b, const int32_t len)=0
 Expert: implements buffer refill.
virtual void seekInternal (const int64_t pos)=0
 Expert: implements seek.

Protected Attributes

int32_t bufferSize
int64_t bufferStart
int32_t bufferLength
int32_t bufferPosition

Detailed Description

Abstract base class for input from a file in a Directory.

A random-access input stream. Used for all Lucene index input operations.

See also:
Directory
IndexOutput

Constructor & Destructor Documentation

lucene::store::BufferedIndexInput::BufferedIndexInput ( const BufferedIndexInput clone  )  [protected]

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.

lucene::store::BufferedIndexInput::BufferedIndexInput ( int32_t  bufferSize = lucene::store::BufferedIndexOutput::BUFFER_SIZE  )  [protected]
virtual lucene::store::BufferedIndexInput::~BufferedIndexInput (  )  [virtual]

Member Function Documentation

virtual IndexInput* lucene::store::BufferedIndexInput::clone (  )  const [pure virtual]
void lucene::store::BufferedIndexInput::close (  )  [virtual]

Closes the stream to futher operations.

Implements lucene::store::IndexInput.

Reimplemented in lucene::store::RAMIndexInput.

int64_t lucene::store::BufferedIndexInput::getFilePointer (  )  const [virtual]

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

See also:
seek(long)

Implements lucene::store::IndexInput.

uint8_t lucene::store::BufferedIndexInput::readByte (  )  [inline, virtual]

Reads and returns a single byte.

See also:
IndexOutput::writeByte(byte)

Implements lucene::store::IndexInput.

void lucene::store::BufferedIndexInput::readBytes ( uint8_t *  b,
const int32_t  len 
) [virtual]

Reads a specified number of bytes into an array at the specified offset.

Parameters:
b the array to read bytes into
offset the offset in the array to start storing bytes
len the number of bytes to read
See also:
IndexOutput::writeBytes(byte[],int32_t)

Implements lucene::store::IndexInput.

virtual void lucene::store::BufferedIndexInput::readInternal ( uint8_t *  b,
const int32_t  len 
) [protected, pure virtual]

Expert: implements buffer refill.

Reads bytes from the current position in the input.

Parameters:
b the array to read bytes into
offset the offset in the array to start storing bytes
length the number of bytes to read

Implemented in lucene::store::RAMIndexInput.

void lucene::store::BufferedIndexInput::seek ( const int64_t  pos  )  [virtual]

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

See also:
getFilePointer()

Implements lucene::store::IndexInput.

virtual void lucene::store::BufferedIndexInput::seekInternal ( const int64_t  pos  )  [protected, pure virtual]

Expert: implements seek.

Sets current position in this file, where the next readInternal(byte[],int32_t,int32_t) will occur.

See also:
readInternal(byte[],int32_t,int32_t)

Implemented in lucene::store::RAMIndexInput.


Member Data Documentation


The documentation for this class was generated from the following file:

clucene.sourceforge.net