org.apache.lucene.index
Class MockIndexInput

java.lang.Object
  extended by org.apache.lucene.store.DataInput
      extended by org.apache.lucene.store.IndexInput
          extended by org.apache.lucene.store.BufferedIndexInput
              extended by org.apache.lucene.index.MockIndexInput
All Implemented Interfaces:
Closeable, Cloneable

public class MockIndexInput
extends BufferedIndexInput

IndexInput backed by a byte[] for testing.


Field Summary
 
Fields inherited from class org.apache.lucene.store.BufferedIndexInput
BUFFER_SIZE
 
Constructor Summary
MockIndexInput(byte[] bytes)
           
 
Method Summary
 void close()
          Closes the stream to further operations.
 long length()
          The number of bytes in the file.
protected  void readInternal(byte[] dest, int destOffset, int len)
          Expert: implements buffer refill.
protected  void seekInternal(long pos)
          Expert: implements seek.
 
Methods inherited from class org.apache.lucene.store.BufferedIndexInput
clone, copyBytes, flushBuffer, getBufferSize, getFilePointer, newBuffer, readByte, readBytes, readBytes, readInt, readLong, readShort, readVInt, readVLong, seek, setBufferSize
 
Methods inherited from class org.apache.lucene.store.IndexInput
skipChars, toString
 
Methods inherited from class org.apache.lucene.store.DataInput
readChars, readString, readStringStringMap, setModifiedUTF8StringsMode
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockIndexInput

public MockIndexInput(byte[] bytes)
Method Detail

readInternal

protected void readInternal(byte[] dest,
                            int destOffset,
                            int len)
Description copied from class: BufferedIndexInput
Expert: implements buffer refill. Reads bytes from the current position in the input.

Specified by:
readInternal in class BufferedIndexInput
Parameters:
dest - the array to read bytes into
destOffset - the offset in the array to start storing bytes
len - the number of bytes to read

close

public void close()
Description copied from class: IndexInput
Closes the stream to further operations.

Specified by:
close in interface Closeable
Specified by:
close in class IndexInput

seekInternal

protected void seekInternal(long pos)
Description copied from class: BufferedIndexInput
Expert: implements seek. Sets current position in this file, where the next BufferedIndexInput.readInternal(byte[],int,int) will occur.

Specified by:
seekInternal in class BufferedIndexInput
See Also:
BufferedIndexInput.readInternal(byte[],int,int)

length

public long length()
Description copied from class: IndexInput
The number of bytes in the file.

Specified by:
length in class IndexInput