Package org.apache.lucene.store
Interface RandomAccessInput
- All Known Implementing Classes:
BufferedIndexInput
,ByteBuffersDataInput
,ByteBuffersIndexInput
public interface RandomAccessInput
Random Access Index API. Unlike
IndexInput
, this has no concept of file position, all
reads are absolute. However, like IndexInput, it is only intended for use by a single thread.-
Method Summary
Modifier and TypeMethodDescriptionisLoaded()
Returns a hint whether all the contents of this input are resident in physical memory.long
length()
The number of bytes in the file.default void
prefetch
(long offset, long length) Prefetch data in the background.byte
readByte
(long pos) Reads a byte at the given position in the filedefault void
readBytes
(long pos, byte[] bytes, int offset, int length) Reads a specified number of bytes starting at a given position into an array at the specified offset.int
readInt
(long pos) Reads an integer (LE byte order) at the given position in the filelong
readLong
(long pos) Reads a long (LE byte order) at the given position in the fileshort
readShort
(long pos) Reads a short (LE byte order) at the given position in the file
-
Method Details
-
length
long length()The number of bytes in the file. -
readByte
Reads a byte at the given position in the file- Throws:
IOException
- See Also:
-
readBytes
Reads a specified number of bytes starting at a given position into an array at the specified offset.- Throws:
IOException
- See Also:
-
readShort
Reads a short (LE byte order) at the given position in the file- Throws:
IOException
- See Also:
-
readInt
Reads an integer (LE byte order) at the given position in the file- Throws:
IOException
- See Also:
-
readLong
Reads a long (LE byte order) at the given position in the file- Throws:
IOException
- See Also:
-
prefetch
Prefetch data in the background.- Throws:
IOException
- See Also:
-
isLoaded
Returns a hint whether all the contents of this input are resident in physical memory.- See Also:
-