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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RAMInputStream.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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
12 namespace Lucene
13 {
15 class RAMInputStream : public IndexInput
16 {
17 public:
18 RAMInputStream();
19 RAMInputStream(RAMFilePtr f);
20 virtual ~RAMInputStream();
21
22 LUCENE_CLASS(RAMInputStream);
23
24 public:
25 static const int32_t BUFFER_SIZE;
26
27 protected:
28 RAMFilePtr file;
29 int64_t _length;
30 ByteArray currentBuffer;
31 int32_t currentBufferIndex;
32 int32_t bufferPosition;
33 int64_t bufferStart;
34 int32_t bufferLength;
35
36 public:
38 virtual void close();
39
41 virtual int64_t length();
42
45 virtual uint8_t readByte();
46
52 virtual void readBytes(uint8_t* b, int32_t offset, int32_t length);
53
56 virtual int64_t getFilePointer();
57
60 virtual void seek(int64_t pos);
61
63 virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
64
65 protected:
66 void switchCurrentBuffer(bool enforceEOF);
67 };
68 }
69
70 #endif

clucene.sourceforge.net