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


 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:
20  virtual ~RAMInputStream();
21 
23 
24  public:
25  static const int32_t BUFFER_SIZE;
26 
27  protected:
29  int64_t _length;
30  ByteArray currentBuffer;
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 
64 
65  protected:
66  void switchCurrentBuffer(bool enforceEOF);
67  };
68 }
69 
70 #endif

clucene.sourceforge.net