public class RAMInputStream extends IndexInput implements java.lang.Cloneable
IndexInput implementation.| Constructor and Description |
|---|
RAMInputStream(RAMFile f)
Deprecated.
|
RAMInputStream(java.lang.String name,
RAMFile f) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
skipChars, toStringclone, readBytes, readChars, readInt, readLong, readShort, readString, readStringStringMap, readVInt, readVLong, setModifiedUTF8StringsMode@Deprecated public RAMInputStream(RAMFile f) throws java.io.IOException
java.io.IOExceptionpublic RAMInputStream(java.lang.String name,
RAMFile f)
throws java.io.IOException
java.io.IOExceptionpublic void close()
IndexInputclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class IndexInputpublic long length()
IndexInputlength in class IndexInputpublic byte readByte()
throws java.io.IOException
DataInputreadByte in class DataInputjava.io.IOExceptionDataOutput.writeByte(byte)public void readBytes(byte[] b,
int offset,
int len)
throws java.io.IOException
DataInputreadBytes in class DataInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readjava.io.IOExceptionDataOutput.writeBytes(byte[],int)public void copyBytes(IndexOutput out, long numBytes) throws java.io.IOException
IndexInputnumBytes 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 IndexInputjava.io.IOExceptionpublic long getFilePointer()
IndexInputgetFilePointer in class IndexInputIndexInput.seek(long)public void seek(long pos)
throws java.io.IOException
IndexInputseek in class IndexInputjava.io.IOExceptionIndexInput.getFilePointer()Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.