public class RAMInputStream extends IndexInput implements Cloneable
IndexInput implementation.| Constructor and Description |
|---|
RAMInputStream(String name,
RAMFile f) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream to further operations.
|
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.
|
IndexInput |
slice(String sliceDescription,
long offset,
long sliceLength)
Creates a slice of this index input, with the given description, offset, and length.
|
clone, getFullSliceDescription, randomAccessSlice, toStringreadBytes, readInt, readLong, readMapOfStrings, readSetOfStrings, readShort, readString, readStringSet, readStringStringMap, readVInt, readVLong, readZInt, readZLong, skipBytespublic RAMInputStream(String name, RAMFile f) throws IOException
IOExceptionpublic void close()
IndexInputclose in interface Closeableclose in interface AutoCloseableclose in class IndexInputpublic long length()
IndexInputlength in class IndexInputpublic byte readByte()
throws IOException
DataInputreadByte in class DataInputIOExceptionDataOutput.writeByte(byte)public void readBytes(byte[] b,
int offset,
int len)
throws 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 readIOExceptionDataOutput.writeBytes(byte[],int)public long getFilePointer()
IndexInputgetFilePointer in class IndexInputIndexInput.seek(long)public void seek(long pos)
throws IOException
IndexInputEOFException and then the
stream is in an undetermined state.seek in class IndexInputIOExceptionIndexInput.getFilePointer()public IndexInput slice(String sliceDescription, long offset, long sliceLength) throws IOException
IndexInputslice in class IndexInputIOExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.