public class MockIndexInputWrapper extends IndexInput
| Constructor and Description |
|---|
MockIndexInputWrapper(MockDirectoryWrapper dir,
String name,
IndexInput delegate)
Construct an empty output buffer.
|
| Modifier and Type | Method and Description |
|---|---|
MockIndexInputWrapper |
clone()
Returns a clone of this stream.
|
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 |
readBytes(byte[] b,
int offset,
int len,
boolean useBuffer)
Reads a specified number of bytes into an array at the
specified offset with control over whether the read
should be buffered (callers who have their own buffer
should pass in "false" for useBuffer).
|
int |
readInt()
Reads four bytes and returns an int.
|
long |
readLong()
Reads eight bytes and returns a long.
|
short |
readShort()
Reads two bytes and returns a short.
|
String |
readString()
Reads a string.
|
Map<String,String> |
readStringStringMap()
Reads a Map<String,String> previously written
with
DataOutput.writeStringStringMap(Map). |
int |
readVInt()
Reads an int stored in variable-length format.
|
long |
readVLong()
Reads a long stored in variable-length format.
|
void |
seek(long pos)
Sets current position in this file, where the next read will occur.
|
IndexInput |
slice(String sliceDescription,
long offset,
long length)
Creates a slice of this index input, with the given description, offset, and length.
|
String |
toString() |
randomAccessSlicereadStringSet, readZInt, readZLong, skipBytespublic MockIndexInputWrapper(MockDirectoryWrapper dir, String name, IndexInput delegate)
public void close()
throws IOException
IndexInputclose in interface Closeableclose in interface AutoCloseableclose in class IndexInputIOExceptionpublic MockIndexInputWrapper clone()
IndexInputClones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.
Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.
Warning: Lucene never closes cloned
IndexInputs, it will only do this on the original one.
The original instance must take care that cloned instances throw
AlreadyClosedException when the original one is closed.
clone in class IndexInputpublic IndexInput slice(String sliceDescription, long offset, long length) throws IOException
IndexInputslice in class IndexInputIOExceptionpublic long getFilePointer()
IndexInputgetFilePointer in class IndexInputIndexInput.seek(long)public void seek(long pos)
throws IOException
IndexInputseek in class IndexInputIOExceptionIndexInput.getFilePointer()public 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 void readBytes(byte[] b,
int offset,
int len,
boolean useBuffer)
throws IOException
DataInputBufferedIndexInput respects this parameter.readBytes in class DataInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readuseBuffer - set to false if the caller will handle
buffering.IOExceptionDataOutput.writeBytes(byte[],int)public short readShort()
throws IOException
DataInputreadShort in class DataInputIOExceptionDataOutput.writeByte(byte)public int readInt()
throws IOException
DataInputreadInt in class DataInputIOExceptionDataOutput.writeInt(int)public long readLong()
throws IOException
DataInputreadLong in class DataInputIOExceptionDataOutput.writeLong(long)public String readString() throws IOException
DataInputreadString in class DataInputIOExceptionDataOutput.writeString(String)public Map<String,String> readStringStringMap() throws IOException
DataInputDataOutput.writeStringStringMap(Map).readStringStringMap in class DataInputIOExceptionpublic int readVInt()
throws IOException
DataInput
The format is described further in DataOutput.writeVInt(int).
readVInt in class DataInputIOExceptionDataOutput.writeVInt(int)public long readVLong()
throws IOException
DataInput
The format is described further in DataOutput.writeVInt(int).
readVLong in class DataInputIOExceptionDataOutput.writeVLong(long)public String toString()
toString in class IndexInputCopyright © 2000–2021 The Apache Software Foundation. All rights reserved.