public class MockIndexInputWrapper extends IndexInput
| Constructor and Description |
|---|
MockIndexInputWrapper(MockDirectoryWrapper dir,
java.lang.String name,
IndexInput delegate,
MockIndexInputWrapper parent)
Sole constructor
|
| 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.
|
java.util.Map<java.lang.String,java.lang.String> |
readMapOfStrings()
Reads a Map<String,String> previously written
with
DataOutput.writeMapOfStrings(Map). |
java.util.Set<java.lang.String> |
readSetOfStrings()
Reads a Set<String> previously written
with
DataOutput.writeSetOfStrings(Set). |
short |
readShort()
Reads two bytes and returns a short.
|
java.lang.String |
readString()
Reads a string.
|
int |
readVInt()
Reads an int stored in variable-length format.
|
long |
readVLong()
Reads a long stored in variable-length format.
|
int |
readZInt()
Read a
zig-zag-encoded
variable-length integer. |
long |
readZLong()
Read a
zig-zag-encoded
variable-length integer. |
void |
seek(long pos)
Sets current position in this file, where the next read will occur.
|
void |
skipBytes(long numBytes)
Skip over
numBytes bytes. |
IndexInput |
slice(java.lang.String sliceDescription,
long offset,
long length)
Creates a slice of this index input, with the given description, offset, and length.
|
java.lang.String |
toString() |
getFullSliceDescription, randomAccessSlicepublic MockIndexInputWrapper(MockDirectoryWrapper dir, java.lang.String name, IndexInput delegate, MockIndexInputWrapper parent)
public void close()
throws java.io.IOException
IndexInputclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class IndexInputjava.io.IOExceptionpublic 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 call IndexInput.close() on the original object.
If you access the cloned IndexInput after closing the original object,
any readXXX methods will throw AlreadyClosedException.
This method is NOT thread safe, so if the current IndexInput
is being used by one thread while clone is called by another,
disaster could strike.
clone in class IndexInputpublic IndexInput slice(java.lang.String sliceDescription, long offset, long length) throws java.io.IOException
IndexInputslice in class IndexInputjava.io.IOExceptionpublic long getFilePointer()
IndexInputgetFilePointer in class IndexInputIndexInput.seek(long)public void seek(long pos)
throws java.io.IOException
IndexInputEOFException and then the
stream is in an undetermined state.seek in class IndexInputjava.io.IOExceptionIndexInput.getFilePointer()public 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 readBytes(byte[] b,
int offset,
int len,
boolean useBuffer)
throws java.io.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.java.io.IOExceptionDataOutput.writeBytes(byte[],int)public short readShort()
throws java.io.IOException
DataInputreadShort in class DataInputjava.io.IOExceptionDataOutput.writeByte(byte)public int readInt()
throws java.io.IOException
DataInputreadInt in class DataInputjava.io.IOExceptionDataOutput.writeInt(int)public long readLong()
throws java.io.IOException
DataInputreadLong in class DataInputjava.io.IOExceptionDataOutput.writeLong(long)public java.lang.String readString()
throws java.io.IOException
DataInputreadString in class DataInputjava.io.IOExceptionDataOutput.writeString(String)public int readVInt()
throws java.io.IOException
DataInput
The format is described further in DataOutput.writeVInt(int).
readVInt in class DataInputjava.io.IOExceptionDataOutput.writeVInt(int)public long readVLong()
throws java.io.IOException
DataInput
The format is described further in DataOutput.writeVInt(int).
readVLong in class DataInputjava.io.IOExceptionDataOutput.writeVLong(long)public int readZInt()
throws java.io.IOException
DataInputzig-zag-encoded
variable-length integer.readZInt in class DataInputjava.io.IOExceptionDataOutput.writeZInt(int)public long readZLong()
throws java.io.IOException
DataInputzig-zag-encoded
variable-length integer. Reads between one and ten
bytes.readZLong in class DataInputjava.io.IOExceptionDataOutput.writeZLong(long)public void skipBytes(long numBytes)
throws java.io.IOException
DataInputnumBytes bytes. The contract on this method is that it
should have the same behavior as reading the same number of bytes into a
buffer and discarding its content. Negative values of numBytes
are not supported.public java.util.Map<java.lang.String,java.lang.String> readMapOfStrings()
throws java.io.IOException
DataInputDataOutput.writeMapOfStrings(Map).readMapOfStrings in class DataInputjava.io.IOExceptionpublic java.util.Set<java.lang.String> readSetOfStrings()
throws java.io.IOException
DataInputDataOutput.writeSetOfStrings(Set).readSetOfStrings in class DataInputjava.io.IOExceptionpublic java.lang.String toString()
toString in class IndexInputCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.