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


Loading...
Searching...
No Matches
RAMInputStream.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef RAMINPUTSTREAM_H
8#define RAMINPUTSTREAM_H
9
10#include "IndexInput.h"
11
12namespace Lucene {
13
15class LPPAPI RAMInputStream : public IndexInput {
16public:
19 virtual ~RAMInputStream();
20
22
23public:
24 static const int32_t BUFFER_SIZE;
25
26protected:
28 int64_t _length;
29 ByteArray currentBuffer;
32 int64_t bufferStart;
33 int32_t bufferLength;
34
35public:
37 virtual void close();
38
40 virtual int64_t length();
41
44 virtual uint8_t readByte();
45
51 virtual void readBytes(uint8_t* b, int32_t offset, int32_t length);
52
55 virtual int64_t getFilePointer();
56
59 virtual void seek(int64_t pos);
60
63
64protected:
65 void switchCurrentBuffer(bool enforceEOF);
66};
67
68}
69
70#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Abstract base class for input from a file in a Directory. A random-access input stream....
Definition IndexInput.h:17
A memory-resident IndexInput implementation.
Definition RAMInputStream.h:15
virtual int64_t length()
The number of bytes in the file.
virtual void readBytes(uint8_t *b, int32_t offset, int32_t length)
Reads a specified number of bytes into an array at the specified offset.
RAMInputStream(const RAMFilePtr &f)
virtual uint8_t readByte()
Reads and returns a single byte.
int64_t bufferStart
Definition RAMInputStream.h:32
virtual void seek(int64_t pos)
Sets current position in this file, where the next read will occur.
ByteArray currentBuffer
Definition RAMInputStream.h:29
virtual void close()
Closes the stream to further operations.
virtual int64_t getFilePointer()
Returns the current position in this file, where the next read will occur.
RAMFilePtr file
Definition RAMInputStream.h:27
static const int32_t BUFFER_SIZE
Definition RAMInputStream.h:24
int64_t _length
Definition RAMInputStream.h:28
int32_t bufferLength
Definition RAMInputStream.h:33
void switchCurrentBuffer(bool enforceEOF)
int32_t currentBufferIndex
Definition RAMInputStream.h:30
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this stream.
int32_t bufferPosition
Definition RAMInputStream.h:31
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
boost::shared_ptr< RAMFile > RAMFilePtr
Definition LuceneTypes.h:506

clucene.sourceforge.net