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.
|
clone, toString
readBytes, readInt, readLong, readShort, readString, readStringSet, readStringStringMap, readVInt, readVLong
public RAMInputStream(String name, RAMFile f) throws IOException
IOException
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 readIOException
DataOutput.writeBytes(byte[],int)
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()
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.