Package org.apache.lucene.store
Class SimpleFSDirectory.SimpleFSIndexInput
- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.store.IndexInput
-
- org.apache.lucene.store.BufferedIndexInput
-
- org.apache.lucene.store.SimpleFSDirectory.SimpleFSIndexInput
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
- Direct Known Subclasses:
NIOFSDirectory.NIOFSIndexInput
- Enclosing class:
- SimpleFSDirectory
protected static class SimpleFSDirectory.SimpleFSIndexInput extends BufferedIndexInput
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SimpleFSDirectory.SimpleFSIndexInput.Descriptor
-
Field Summary
Fields Modifier and Type Field Description protected int
chunkSize
protected SimpleFSDirectory.SimpleFSIndexInput.Descriptor
file
-
Fields inherited from class org.apache.lucene.store.BufferedIndexInput
buffer, BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description SimpleFSIndexInput(File path, int bufferSize, int chunkSize)
Deprecated.please pass resourceDescSimpleFSIndexInput(String resourceDesc, File path, int bufferSize, int chunkSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Returns a clone of this stream.void
close()
Closes the stream to further operations.void
copyBytes(IndexOutput out, long numBytes)
CopiesnumBytes
bytes to the givenIndexOutput
.long
length()
The number of bytes in the file.protected void
readInternal(byte[] b, int offset, int len)
IndexInput methodsprotected void
seekInternal(long position)
Expert: implements seek.-
Methods inherited from class org.apache.lucene.store.BufferedIndexInput
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
-
-
-
-
Field Detail
-
file
protected final SimpleFSDirectory.SimpleFSIndexInput.Descriptor file
-
chunkSize
protected final int chunkSize
-
-
Constructor Detail
-
SimpleFSIndexInput
@Deprecated public SimpleFSIndexInput(File path, int bufferSize, int chunkSize) throws IOException
Deprecated.please pass resourceDesc- Throws:
IOException
-
SimpleFSIndexInput
public SimpleFSIndexInput(String resourceDesc, File path, int bufferSize, int chunkSize) throws IOException
- Throws:
IOException
-
-
Method Detail
-
readInternal
protected void readInternal(byte[] b, int offset, int len) throws IOException
IndexInput methods- Specified by:
readInternal
in classBufferedIndexInput
- Parameters:
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to read- Throws:
IOException
-
close
public void close() throws IOException
Description copied from class:IndexInput
Closes the stream to further operations.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classIndexInput
- Throws:
IOException
-
seekInternal
protected void seekInternal(long position)
Description copied from class:BufferedIndexInput
Expert: implements seek. Sets current position in this file, where the nextBufferedIndexInput.readInternal(byte[],int,int)
will occur.- Specified by:
seekInternal
in classBufferedIndexInput
- 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 classIndexInput
-
clone
public Object clone()
Description copied from class:DataInput
Returns a clone of this stream.Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.
Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.
- Overrides:
clone
in classBufferedIndexInput
-
copyBytes
public void copyBytes(IndexOutput out, long numBytes) throws IOException
Description copied from class:IndexInput
CopiesnumBytes
bytes to the givenIndexOutput
.NOTE: this method uses an intermediate buffer to copy the bytes. Consider overriding it in your implementation, if you can make a better, optimized copy.
NOTE ensure that there are enough bytes in the input to copy to output. Otherwise, different exceptions may be thrown, depending on the implementation.
- Overrides:
copyBytes
in classBufferedIndexInput
- Throws:
IOException
-
-