|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.store.DataInput org.apache.lucene.store.IndexInput org.apache.lucene.store.RAMInputStream
public class RAMInputStream
A memory-resident IndexInput
implementation.
Field Summary |
---|
Fields inherited from class org.apache.lucene.store.IndexInput |
---|
copyBuf |
Constructor Summary | |
---|---|
RAMInputStream(RAMFile f)
|
Method Summary | |
---|---|
void |
close()
Closes the stream to further operations. |
void |
copyBytes(IndexOutput out,
long numBytes)
Copies numBytes bytes to the given IndexOutput . |
long |
getFilePointer()
Returns the current position in this file, where the next read will occur. |
long |
length()
The number of bytes in the file. |
byte |
readByte()
Reads and returns a single byte. |
void |
readBytes(byte[] b,
int offset,
int len)
Reads a specified number of bytes into an array at the specified offset. |
void |
seek(long pos)
Sets current position in this file, where the next read will occur. |
Methods inherited from class org.apache.lucene.store.IndexInput |
---|
skipChars |
Methods inherited from class org.apache.lucene.store.DataInput |
---|
clone, readBytes, readChars, readInt, readLong, readShort, readString, readStringStringMap, readVInt, readVLong, setModifiedUTF8StringsMode |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RAMInputStream(RAMFile f) throws IOException
IOException
Method Detail |
---|
public void close()
IndexInput
close
in interface Closeable
close
in class IndexInput
public long length()
IndexInput
length
in class IndexInput
public byte readByte() throws IOException
DataInput
readByte
in class DataInput
IOException
DataOutput.writeByte(byte)
public void readBytes(byte[] b, int offset, int len) throws IOException
DataInput
readBytes
in class DataInput
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to read
IOException
DataOutput.writeBytes(byte[],int)
public void copyBytes(IndexOutput out, long numBytes) throws IOException
IndexInput
numBytes
bytes to the given IndexOutput
.
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.
copyBytes
in class IndexInput
IOException
public long getFilePointer()
IndexInput
getFilePointer
in class IndexInput
IndexInput.seek(long)
public void seek(long pos) throws IOException
IndexInput
seek
in class IndexInput
IOException
IndexInput.getFilePointer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |