Package org.apache.lucene.index
Class MockIndexInput
- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.store.IndexInput
-
- org.apache.lucene.store.BufferedIndexInput
-
- org.apache.lucene.index.MockIndexInput
-
- All Implemented Interfaces:
Closeable,AutoCloseable,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
Constructors Constructor Description MockIndexInput(byte[] bytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the stream to further operations.longlength()The number of bytes in the file.protected voidreadInternal(byte[] dest, int destOffset, int len)Expert: implements buffer refill.protected voidseekInternal(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
-
-
-
-
Method Detail
-
readInternal
protected void readInternal(byte[] dest, int destOffset, int len)Description copied from class:BufferedIndexInputExpert: implements buffer refill. Reads bytes from the current position in the input.- Specified by:
readInternalin classBufferedIndexInput- Parameters:
dest- the array to read bytes intodestOffset- the offset in the array to start storing byteslen- the number of bytes to read
-
close
public void close()
Description copied from class:IndexInputCloses the stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classIndexInput
-
seekInternal
protected void seekInternal(long pos)
Description copied from class:BufferedIndexInputExpert: implements seek. Sets current position in this file, where the nextBufferedIndexInput.readInternal(byte[],int,int)will occur.- Specified by:
seekInternalin classBufferedIndexInput- See Also:
BufferedIndexInput.readInternal(byte[],int,int)
-
length
public long length()
Description copied from class:IndexInputThe number of bytes in the file.- Specified by:
lengthin classIndexInput
-
-