Class ByteArrayIndexInput
- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.store.IndexInput
-
- org.apache.lucene.store.ByteArrayIndexInput
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable,RandomAccessInput
@Deprecated public final class ByteArrayIndexInput extends IndexInput implements RandomAccessInput
Deprecated.Will be removed in future Lucene versions. Use byte buffer backed index inputs instead.AIndexInputbacked by a byte array.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayIndexInput(String description, byte[] bytes)Deprecated.ByteArrayIndexInput(String description, byte[] bytes, int offs, int length)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IndexInputclone()Deprecated.Returns a clone of this stream.voidclose()Deprecated.Closes the stream to further operations.longgetFilePointer()Deprecated.Returns the current position in this file, where the next read will occur.longlength()Deprecated.The number of bytes in the file.bytereadByte()Deprecated.Reads and returns a single byte.bytereadByte(long pos)Deprecated.Reads a byte at the given position in the filevoidreadBytes(byte[] b, int offset, int len)Deprecated.Reads a specified number of bytes into an array at the specified offset.intreadInt()Deprecated.Reads four bytes and returns an int.intreadInt(long pos)Deprecated.Reads an integer at the given position in the filelongreadLong()Deprecated.Reads eight bytes and returns a long.longreadLong(long pos)Deprecated.Reads a long at the given position in the fileshortreadShort()Deprecated.Reads two bytes and returns a short.shortreadShort(long pos)Deprecated.Reads a short at the given position in the fileintreadVInt()Deprecated.Reads an int stored in variable-length format.longreadVLong()Deprecated.Reads a long stored in variable-length format.voidseek(long pos)Deprecated.Sets current position in this file, where the next read will occur.ByteArrayIndexInputslice(String sliceDescription, long offset, long length)Deprecated.Creates a slice of this index input, with the given description, offset, and length.-
Methods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, randomAccessSlice, toString
-
Methods inherited from class org.apache.lucene.store.DataInput
readBytes, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong, skipBytes
-
-
-
-
Method Detail
-
getFilePointer
public long getFilePointer()
Deprecated.Description copied from class:IndexInputReturns the current position in this file, where the next read will occur.- Specified by:
getFilePointerin classIndexInput- See Also:
IndexInput.seek(long)
-
seek
public void seek(long pos) throws EOFExceptionDeprecated.Description copied from class:IndexInputSets current position in this file, where the next read will occur. If this is beyond the end of the file then this will throwEOFExceptionand then the stream is in an undetermined state.- Specified by:
seekin classIndexInput- Throws:
EOFException- See Also:
IndexInput.getFilePointer()
-
length
public long length()
Deprecated.Description copied from class:IndexInputThe number of bytes in the file.- Specified by:
lengthin classIndexInput
-
readShort
public short readShort()
Deprecated.Description copied from class:DataInputReads two bytes and returns a short.- Overrides:
readShortin classDataInput- See Also:
DataOutput.writeByte(byte)
-
readInt
public int readInt()
Deprecated.Description copied from class:DataInputReads four bytes and returns an int.- Overrides:
readIntin classDataInput- See Also:
DataOutput.writeInt(int)
-
readLong
public long readLong()
Deprecated.Description copied from class:DataInputReads eight bytes and returns a long.- Overrides:
readLongin classDataInput- See Also:
DataOutput.writeLong(long)
-
readVInt
public int readVInt()
Deprecated.Description copied from class:DataInputReads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are supported, but should be avoided.The format is described further in
DataOutput.writeVInt(int).- Overrides:
readVIntin classDataInput- See Also:
DataOutput.writeVInt(int)
-
readVLong
public long readVLong()
Deprecated.Description copied from class:DataInputReads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.The format is described further in
DataOutput.writeVInt(int).- Overrides:
readVLongin classDataInput- See Also:
DataOutput.writeVLong(long)
-
readByte
public byte readByte()
Deprecated.Description copied from class:DataInputReads and returns a single byte.- Specified by:
readBytein classDataInput- See Also:
DataOutput.writeByte(byte)
-
readBytes
public void readBytes(byte[] b, int offset, int len)Deprecated.Description copied from class:DataInputReads a specified number of bytes into an array at the specified offset.- Specified by:
readBytesin classDataInput- Parameters:
b- the array to read bytes intooffset- the offset in the array to start storing byteslen- the number of bytes to read- See Also:
DataOutput.writeBytes(byte[],int)
-
close
public void close()
Deprecated.Description copied from class:IndexInputCloses the stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classIndexInput
-
clone
public IndexInput clone()
Deprecated.Description copied from class:IndexInputReturns a clone of this stream.Clones 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 callIndexInput.close()on the original object.If you access the cloned IndexInput after closing the original object, any
readXXXmethods will throwAlreadyClosedException.This method is NOT thread safe, so if the current
IndexInputis being used by one thread whilecloneis called by another, disaster could strike.- Overrides:
clonein classIndexInput
-
slice
public ByteArrayIndexInput slice(String sliceDescription, long offset, long length)
Deprecated.Description copied from class:IndexInputCreates a slice of this index input, with the given description, offset, and length. The slice is seeked to the beginning.- Specified by:
slicein classIndexInput
-
readByte
public byte readByte(long pos) throws IOExceptionDeprecated.Description copied from interface:RandomAccessInputReads a byte at the given position in the file- Specified by:
readBytein interfaceRandomAccessInput- Throws:
IOException- See Also:
DataInput.readByte()
-
readShort
public short readShort(long pos) throws IOExceptionDeprecated.Description copied from interface:RandomAccessInputReads a short at the given position in the file- Specified by:
readShortin interfaceRandomAccessInput- Throws:
IOException- See Also:
DataInput.readShort()
-
readInt
public int readInt(long pos) throws IOExceptionDeprecated.Description copied from interface:RandomAccessInputReads an integer at the given position in the file- Specified by:
readIntin interfaceRandomAccessInput- Throws:
IOException- See Also:
DataInput.readInt()
-
readLong
public long readLong(long pos) throws IOExceptionDeprecated.Description copied from interface:RandomAccessInputReads a long at the given position in the file- Specified by:
readLongin interfaceRandomAccessInput- Throws:
IOException- See Also:
DataInput.readLong()
-
-